select top 20 count(v.postid) as 'Vote count', v.postid ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Christianity

Q&A for committed Christians, experts in Christianity and those interested in learning more

-- Most Upvoted Answers
-- The top 20 answers with the most up-votes (ignores down-votes)

select top 20 count(v.postid) as 'Vote count', v.postid AS [Post Link],p.body
from votes v 
inner join posts p on p.id=v.postid
where PostTypeId = 2 and VoteTypeId=2
group by v.postid,p.body
order by 'Vote count' asc

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results