Question distribution by number of views

0

Please login or register to vote for this query.

(click on this box to dismiss)

Which questions have the most views and which the smallest, summed into 'buckets'

Italian Language Meta

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 > 100 then 1 end) as MiniPosts,
    sum(case when ViewCount <= 100 and ViewCount > 20 then 1 end) as TinyPosts,  
    sum(case when ViewCount <= 20 then 1 end) as ForgottenPosts
    
FROM
     Posts p
WHERE
    p.ParentId is null

Enter Parameters

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