Number of questions by reputation for users with reputation > 20,000, per month since 2011

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT
     Year(Posts.CreationDate) as Year,
     Month(Posts.CreationDate) as Month,
     SUM(Case when Users.Reputation <= 30000 AND Users.Reputation > 20000 then 1 else 0 end) As "20000 -
     30000",
     SUM(Case when Users.Reputation <= 40000 AND Users.Reputation > 30000 then 1 else 0 end) As "30000 -
     40000",
     SUM(Case when Users.Reputation <= 50000 AND Users.Reputation > 40000 then 1 else 0 end) As "40000 -
     50000",
     SUM(Case when Users.Reputation <= 75000 AND Users.Reputation > 50000 then 1 else 0 end) As "50000 -
     75000",
     SUM(Case when Users.Reputation <= 100000 AND Users.Reputation > 75000 then 1 else 0 end) As "75000 -
     100000",
     SUM(Case when Users.Reputation <= 250000 AND Users.Reputation > 100000 then 1 else 0 end) As "100000 -
     250000",
     SUM(Case when Users.Reputation > 250000  then 1 else 0 end) As "> 250000",
     COUNT(*) AS 'All users'
FROM  Users
INNER JOIN Posts on Posts.OwnerUserId = Users.Id
    and Posts.PostTypeId = 1
    and Users.Reputation > 20000
WHERE Year(Posts.CreationDate) > 2010
GROUP BY Year(Posts.CreationDate), Month(Posts.CreationDate)
ORDER BY Year, Month

Enter Parameters

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