Number of users by number of digits of reputation

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
  concat(power(10, rep_digits - 1) + 1, '-', power(10, rep_digits)) rep_bracket,
  count,
  cast((count * 100.0) / (select count(*) from users) as decimal(4,2)) as percentage
from (
  select
    ceiling(log10(reputation)) as rep_digits,
    count(*) count
    from users
    group by ceiling(log10(reputation))) x
order by rep_digits

Enter Parameters

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