Q&A about the site for enthusiasts and scholars of mythology and folklore
SELECT concat_ws( '-', YEAR ( creationdate ), RIGHT ( '00' + CONVERT ( NVARCHAR ( 2 ), MONTH ( creationdate )), 2 )) AS YEAR_MONTH, count( id ) AS count_posts_by_year_month FROM posts GROUP BY concat_ws( '-', YEAR ( creationdate ), RIGHT ( '00' + CONVERT ( NVARCHAR ( 2 ), MONTH ( creationdate )), 2 )) ORDER BY YEAR_MONTH;