with the_users as ( select u.id , max(u.reputation) as re...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Music Fans

Q&A for music historians, critics, and fans

with the_users as (
select u.id
     , max(u.reputation) as rep
     , count(*) as posts
     , cast(sum(p.score) as float ) / count(*) as score_per_post
  from users u
  join posts p
    on u.id = p.owneruserid
 where p.posttypeid in (1,2)
 group by u.id
       )
select floor(log10(rep)) as rep_magnitiude
, floor(log10(posts)) as post_mag
     , avg(score_per_post) as avg_score_per_post
     , min(score_per_post) as min_score_per_post
  from the_users
 group by floor(log10(rep)), floor(log10(posts))
 order by floor(log10(rep)) asc

Enter Parameters

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