HW2-1

0

Please login or register to vote for this query.

(click on this box to dismiss)

Bicycles

Q&A for people who build and repair bicycles, people who train cycling, or commute on bicycles

SELECT
	concat_ws(
		'-',
		YEAR ( creationdate ),
	RIGHT ( '00' + CONVERT ( NVARCHAR ( 2 ), MONTH ( creationdate )), 2 )) AS YEAR_MONTH,
	posttypeid,
	count( id ) AS cnt 
FROM
	posts 
GROUP BY
	PostTypeId,
	concat_ws(
		'-',
		YEAR ( creationdate ),
	RIGHT ( '00' + CONVERT ( NVARCHAR ( 2 ), MONTH ( creationdate )), 2 )) 
ORDER BY
	cnt DESC;

Enter Parameters

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