Users with the most Favorites

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 U.Id AS [User Link], (SELECT Count(V.Id) AS [FAVORITES] FROM Votes V, VoteTypes Vt WHERE Vt.Id = V.VoteTypeId AND U.Id = V.UserId AND Vt.Id = 5) AS [FAVS]
FROM Users U
WHERE
(SELECT Count(V.Id) AS [FAVORITES] FROM Votes V, VoteTypes Vt WHERE Vt.Id = V.VoteTypeId AND U.Id = V.UserId AND Vt.Id = 5) > 1000
ORDER BY FAVS DESC

Enter Parameters

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