Q&A for scientists using computers to solve scientific problems
SELECT p.Id, COUNT(v.Id), p.Id AS [Post Link], url = 'site://q/' + CAST(p.Id AS varchar), 'site://revisions/'+cast(p.Id as nvarchar)+'/1' AS [Revisions Link] --- p.CreationDate, p.DeletionDate FROM PostsWithDeleted p INNER JOIN Votes v ON v.PostId = p.Id WHERE (v.VoteTypeId IN (##types?4,12##)) AND (p.DeletionDate IS NULL) GROUP BY p.Id ORDER BY COUNT(v.Id) DESC