Posts per month (answers and questions)

0

Please login or register to vote for this query.

(click on this box to dismiss)

Webmasters

Q&A for pro webmasters

SELECT
    DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) AS Month,
    SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS QuestionCount,
    SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS AnswerCount
FROM
    Posts
WHERE 
    CreationDate > '2009-01-01'
GROUP BY
    DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0)
ORDER BY
    Month;

Enter Parameters

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