Users with gold badges, sorted by gold badges in descending order

1

Please login or register to vote for this query.

(click on this box to dismiss)

Webmasters

Q&A for pro webmasters

SELECT u.Id AS [User Link],
  MAX(b.Name) AS 'One of the gold badges they have',
  COUNT(*) AS 'Number of gold badges'
FROM Users AS u
INNER JOIN Badges AS b
  ON b.UserId = u.Id
WHERE b.Class = 1
GROUP BY u.Id
ORDER BY COUNT(*) DESC;

Enter Parameters

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