with cPosts(UserID, countPosts) as ( select users.id a...


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

with cPosts(UserID, countPosts)



                select users.id as userId,count(posts.id) as countPosts

                from users, posts

                where users.id=posts.OwnerUserId and

                        posts.PostTypeId = 1

                group by users.id


select  (select count(countPosts) 

        from cPosts 

        where  countPosts<10) as lessThan10,

        (select count(countPosts) 

        from cPosts 

        where  countPosts>=10 and countPosts<=20) as lessThan20,

        (select count(countPosts) 

        from cPosts 

        where  countPosts>20) as moreThan20

Enter Parameters

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