Users by reputation bracket

0

Please login or register to vote for this query.

(click on this box to dismiss)

Show the number of users according to their reputation bracket (1–9, 10–99, 100–999, …). Users who have created an account but never earned reputation or who have only earned reputation from the association bonus or from now-deleted posts are excluded from these lists and counted separately.

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT * FROM ((
  SELECT
    Count(*) AS [Count],
    'no visible participation' AS [Range]
  FROM Users u
  WHERE NOT EXISTS (SELECT p.Id FROM Posts p WHERE p.OwnerUserId = u.Id)
    AND NOT EXISTS (SELECT s.Id FROM SuggestedEdits s WHERE s.OwnerUserId = u.Id)
) UNION (
  SELECT
    Count(*) AS [Count],
    ' ' + Str(Power(5, Floor(Log10(u.Reputation))), 8) + '–' + LTrim(Str(Power(10, Floor(Log10(u.Reputation)) + 1) - 1)) AS [Range]
  FROM Users u
  WHERE EXISTS (SELECT p.Id FROM Posts p WHERE p.OwnerUserId = u.Id)
     OR EXISTS (SELECT s.Id FROM SuggestedEdits s WHERE s.OwnerUserId = u.Id)
  GROUP BY Floor(Log10(u.Reputation))
)) results
ORDER BY IIF(CharIndex('1', results.Range) = 0, 0, Len(results.Range))

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results