Users who hold at least one silver tag badge

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

-- http://meta.stackexchange.com/questions/148147/can-we-expose-class-for-badges-in-data-explorer

WITH TagBadges AS (
  SELECT
    u.Id AS [UserId],
    Max(u.Reputation) AS [Reputation],
    b.Name AS [Name],
    Count(*) AS [Level]
  FROM Users u
  INNER JOIN Badges b ON u.Id = b.UserId
  WHERE ASCII(LEFT(b.Name, 1)) BETWEEN 97 AND 122
  GROUP BY b.Name, u.Id
)
SELECT
  UserId AS [User Link],
  Max(Reputation) AS [Rep],
  Count(*) AS [Count]
FROM TagBadges tb
WHERE tb.Level = 2
GROUP BY UserId
ORDER BY Max(Reputation) DESC, UserId DESC

Enter Parameters

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