Users with the most favorites

0

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 ##number## * from (
    SELECT COUNT(*) AS favcnt, Votes.UserId AS [User Link]
    FROM Votes 
      INNER JOIN 
        Users ON Votes.UserId = Users.Id
    WHERE Votes.VoteTypeId = 5
    GROUP BY UserId
    ) subq
ORDER BY favcnt DESC

Enter Parameters

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