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