Find number of answers per month since 2012 for Trusted Users

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

SELECT u.Id, u.Reputation, u.DisplayName, DATEPART(YEAR, p.CreationDate) as Year, DATEPART(MONTH, p.CreationDate) as Month, Count(*) as Count 
        FROM Users u
        inner join Posts p on u.Id = p.OwnerUserId
        where DATEPART(Year, p.CreationDate) >=  2012 and 
        p.PostTypeId = 2
        and u.Reputation >= 20000
        GROUP BY u.Id, u.Reputation, u.DisplayName, DATEPART(YEAR, p.CreationDate), DATEPART(MONTH, p.CreationDate)
        ORDER BY -Reputation, u.Id, Year, Month ASC

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached