Would-be Diversity Badge Winners

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

SELECT ROUND(t.Reputation / 2, -2) * 2, COUNT(t.Id)
FROM (
  SELECT u.Id, u.Reputation
  FROM (
    SELECT a.OwnerUserId, pt.TagId
    FROM PostTags pt
    JOIN Posts q ON pt.PostId = q.Id
    JOIN Posts a ON a.ParentId = q.Id
    GROUP BY a.OwnerUserId, pt.TagId
    HAVING SUM(a.Score) > 1) s
  JOIN Users u ON u.Id = s.OwnerUserId
  WHERE u.Reputation > 1 -- not suspended
  GROUP BY u.Id, u.Reputation
  HAVING COUNT(s.TagId) = 50
) t
GROUP BY ROUND(t.Reputation / 2, -2) * 2

Enter Parameters

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