Most gold, silver, bronze tag badges

1

Please login or register to vote for this query.

(click on this box to dismiss)

The Workplace Meta

Q&A about the site for members of the workforce navigating the professional setting

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

Enter Parameters

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