Users with gold badges

0

Please login or register to vote for this query.

(click on this box to dismiss)

Physics

Q&A for active researchers, academics and students of physics

SELECT Top(100) u.Id AS [User ID],
  'https://stackoverflow.com/users/' + CAST(u.Id AS nvarchar) 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
  FROM Users AS u
  INNER JOIN Badges AS b
  ON b.UserId = u.Id
  WHERE u.CreationDate >= '2016-01-01 00:00:00'
  GROUP BY u.Id
  Order By gold DESC

Enter Parameters

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