Users with most favorites on their questions

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT TOP ##num?500##
  RANK() OVER(ORDER BY COUNT(*) DESC) AS Rank,
  p.OwnerUserId AS [User Link], p.OwnerDisplayName,
  COUNT(*) AS [# favorite]
FROM Posts p INNER JOIN Votes v on v.PostId=p.Id  
WHERE v.VoteTypeId = 5 -- favorite
GROUP BY p.OwnerUserId, p.OwnerDisplayName
ORDER BY COUNT(*) DESC

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results