Number of questions monthly

0

Please login or register to vote for this query.

(click on this box to dismiss)

Vegetarianism

Q&A for those committed to a vegan or vegetarian lifestyle and anyone interested in learning more

SELECT
DATEPART(YEAR, Posts.CreationDate) Year,
DATEPART(MONTH, Posts.CreationDate) Month,
SUM(CASE WHEN Posts.Id = 1 THEN 1 ELSE 0 END) Questions,
SUM(CASE WHEN Posts.Id = 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