Users with lowest reputation who have a gold badge


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 badges_cte AS (
  UserId AS uid,
  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

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

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results