Users with at least n gold badges


Please login or register to vote for this query.

(click on this box to dismiss)

Reverse Engineering Meta

Q&A about the site for researchers and developers who explore the principles of a system through analysis of its structure, function, and operation

;with tagbadges_cte AS (
  b.UserId AS uid,
  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 = Name

SELECT TOP(##num?100##)
  u.Id As [User Link],
  u.Reputation,, b.silver, b.bronze
FROM tagbadges_cte b INNER JOIN Users u ON b.uid=u.Id
WHERE (gold>=##min?5##)
ORDER BY gold DESC,silver DESC,bronze DESC

Enter Parameters

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