Number of questions monthly

0

Please login or register to vote for this query.

(click on this box to dismiss)

Earth Science

Q&A for those interested in the geology, meteorology, oceanography, and environmental sciences

SELECT
DATEPART(YEAR, Posts.CreationDate) Year,
DATEPART(MONTH, Posts.CreationDate) Month,
SUM(CASE WHEN Posts.PostTypeid = 1 THEN 1 ELSE 0 END) Questions,
SUM(CASE WHEN Posts.PostTypeid = 2 THEN 1 ELSE 0 END) Answers
FROM Posts
WHERE PostTypeid IN (1, 2)
GROUP BY DATEPART(YEAR, Posts.CreationDate), DATEPART(MONTH, Posts.CreationDate)
ORDER BY Year, Month

Enter Parameters

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