Posts of specified kind with most votes of specified kind
Q&A about the site for professional and enthusiast programmers
-- Count: Number of posts -- PostTypeId: Post type: Question (1), Answer (2) -- VoteTypeId: Vote type: Upvote (2), Downvote (3) select top ##Count:int?100## count(v.PostId) as VoteCount, p.CreationDate, v.PostId AS [Post Link], p.Body from votes v inner join posts p on p.Id = v.PostId where p.PostTypeId = ##PostTypeId:int?1## and v.VoteTypeId = ##VoteTypeId:int?2## group by p.CreationDate, v.PostId, p.Body order by VoteCount desc