Most gold, silver, bronze badges

1

Please login or register to vote for this query.

(click on this box to dismiss)

Science Fiction and Fantasy

Q&A for science fiction and fantasy enthusiasts

SELECT TOP(##num?200##)
  UserId AS [User Link],
  sum(case when class = 1 then 1 else 0 end) AS gold,
  sum(case when class = 2 then 1 else 0 end) AS silver,
  sum(case when class = 3 then 1 else 0 end) AS bronze,
  count(Id) AS total
FROM Badges
GROUP BY UserId
ORDER BY gold DESC, silver DESC, bronze DESC, total DESC

Enter Parameters

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