Users with highest badgesCount / rep ratio

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 10 UserId AS [User Link],
      (SELECT Reputation FROM Users WHERE Id=UserId) AS Reputation,
      COUNT(*) AS [Total Badges],
      cast(Count(*) as float)/(SELECT Reputation FROM Users WHERE Id=UserId) As Ratio
    FROM Badges
    WHERE (SELECT Reputation FROM Users WHERE Id=UserId) >= ##MinScore:int##
    GROUP BY UserId
    ORDER BY Ratio DESC

Enter Parameters

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