select *, case when "post_count" = 0 then '0' when "post...


Please login or register to vote for this query.

(click on this box to dismiss)

Motor Vehicle Maintenance and Repair Meta

Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles

select *,

  case when "post_count" = 0 then '0'
  when "post_count" > 0 and "post_count" <= 10 then '1-10'
  when "post_count" > 10 then '10+' end as groups,
  (select count(Id) from Users) as "total_user_count"--,
  --count(Id)/"total_user_count" over (partition by groups) as "percentages"

select u.Id, count(p.Id) as "post_count" 

from Users u
full outer join Posts p on (p.OwnerUserID = u.Id)
where p.Id is not null
group by u.Id)t
--group by Id, post_count, groups

Enter Parameters

Switch to main site
loading Hold tight while we fetch your results