select sum(case when x.c = 0 then 1 else 0 end) from ( se...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Portuguese Language

Q&A for linguists, teachers and learners wanting to discuss the finer points of the Portuguese language

select sum(case when x.c = 0 then 1 else 0 end)
from (
select sum(case when posttypes.id = 1 then 1 else 0 end) as c from users
left join posts on posts.owneruserid = users.id
left join posttypes on posttypes.id = posts.posttypeid
group by users.id
) as x

Enter Parameters

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