Q&A for professional and enthusiast programmers
/****** Script for SelectTopNRows command from SSMS ******/ SELECT (CONVERT(nvarchar(50), [Year]) +'-'+ RIGHT('0' + CONVERT(nvarchar(50), [Month]), 2)) AS [Month], NumQuestions FROM( SELECT DATEPART(year, CreationDate) [Year], DATEPART(month, CreationDate) [Month], COUNT(*) [NumQuestions] FROM [StackOverflow].[dbo].[Posts] with(nolock) WHERE Tags LIKE '%hadoop%' AND PostTypeId = 1 GROUP BY DATEPART(year, CreationDate), DATEPART(month, CreationDate) ) X ORDER BY 1 ASC