Q&A for scientists using computers to solve scientific problems
WITH b AS (SELECT UserId, Name FROM Badges WHERE Name IN ('Civic Duty', 'Cleanup', 'Deputy', 'Electorate', 'Marshal', 'Reviewer', 'Sportsmanship', 'Steward') GROUP BY UserId, Name) SELECT UserId AS [User Link], COUNT(*) AS 'Number of moderation badges' FROM b GROUP BY UserId ORDER BY COUNT(*) DESC