Question 1

0

Please login or register to vote for this query.

(click on this box to dismiss)

Meta Stack Exchange

Q&A for meta-discussion of the Stack Exchange family of Q&A websites

---We want to get some ideas of how many posts were written each month. 
---Use SQL to count the number of posts by year-month. 
---Note that by year-month, we mean that May 2013 and May 2014 should be considered as different year-months. 
---The result table should show year-month and count and order results by year-month.

SELECT concat(YEAR(CreationDate), '-', MONTH(CreationDate)) as year_month, count(*) AS cnt, PostTypeId
FROM Posts
GROUP BY concat(YEAR(CreationDate), '-', MONTH(CreationDate)), PostTypeId
ORDER BY cnt DESC;

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results