Q&A for linguists, teachers and learners wanting to discuss the finer points of the Portuguese language
select count (Id) as result from ( select u.Id ,count(OwnerUserId) as posts_count from Posts p join Users u on p.OwnerUserId = u.Id where p.PostTypeId = 1 group by u.Id) r where posts_count < 10 union select count(Id) as result from ( select u.Id ,count(OwnerUserId) as posts_count from Posts p join Users u on p.OwnerUserId = u.Id where p.PostTypeId = 1 group by u.Id) r where posts_count >= 10 and posts_count < 20 union select count(Id) as result from ( select u.Id ,count(OwnerUserId) as posts_count from Posts p join Users u on p.OwnerUserId = u.Id where p.PostTypeId = 1 group by u.Id) r where posts_count > 20