select sum(case when ct<10 then 1 else 0 end) as one, sum...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Physics

Q&A for active researchers, academics and students of physics

select
sum(case when ct<10 then 1 else 0 end) as one,
sum(case when ct>=10 and ct<=20 then 1 else 0 end) as two ,
sum(case when ct>20 then 1 else 0 end) as three
from (
select owneruserid, count(PostTypeId) ct
from posts
where PostTypeId= 1
group by owneruserid
)t;

Enter Parameters

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