Users by # of moderation badges

0

Please login or register to vote for this query.

(click on this box to dismiss)

Webmasters

Q&A for pro webmasters

SELECT
  Users.Id AS [User Link]
  , Users.CreationDate
  , Users.LastAccessDate
  , b.num_badges
 FROM
   Users LEFT JOIN (
   SELECT UserId, COUNT(DISTINCT Name) num_badges
   FROM Badges
   WHERE Name IN (
    'Civic Duty',
    'Cleanup',
    'Deputy',
    'Electorate',
    'Marshal',
    'Reviewer',
    'Sportsmanship',
    'Steward'
  )
  GROUP BY UserId) b ON Users.Id = b.UserId

Enter Parameters

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