Which questions have the most views and which the smallest, summed into 'buckets'
Q&A about the site for students, teachers, and linguists wanting to discuss the finer points of the Italian language
-- Question distribution by number of views -- Which questions have the most views and which the smallest, summed into 'buckets' select sum(case when ViewCount > 100000 then 1 end) as PopPosts, sum(case when ViewCount <= 100000 and ViewCount > 50000 then 1 end) as HugePosts, sum(case when ViewCount <= 50000 and ViewCount > 10000 then 1 end) as LargePosts, sum(case when ViewCount <= 10000 and ViewCount > 5000 then 1 end) as MedPosts, sum(case when ViewCount <= 5000 and ViewCount > 2500 then 1 end) as RegPosts, sum(case when ViewCount <= 2500 and ViewCount > 1000 then 1 end) as SmallPosts, sum(case when ViewCount <= 1000 and ViewCount > 500 then 1 end) as TinyPosts, sum(case when ViewCount <= 500 and ViewCount > 300 then 1 end) as MiniPosts, sum(case when ViewCount <= 300 and ViewCount > 100 then 1 end) as MicroPosts, sum(case when ViewCount <= 100 then 1 end) as ForgottenPosts FROM Posts p WHERE p.ParentId is null