Shows the trend for your favourite tag
Q&A about the site for software quality control experts, automation engineers, and software testers
-- How many posts per month for a tag? -- Shows the trend for your favourite tag DECLARE @TagName varchar(255) = '##TagName##' SELECT r.PYear, r.PMonth, (SELECT COUNT(*) FROM Posts WHERE Posts.Tags LIKE '%<##TagName##>%' AND DATEADD(month, DATEPART(month, Posts.CreationDate), DATEADD(year, DATEPART(year, Posts.CreationDate), 0)) <= DATEADD(month,r.PMonth,DATEADD(year,r.PYear, 0))) as Posts FROM ( SELECT DISTINCT YEAR(Posts.CreationDate) as PYear, MONTH(Posts.CreationDate) as PMonth FROM Posts WHERE Posts.Tags LIKE '%<##TagName##>%' ) AS r GROUP BY r.Pyear, r.PMonth ORDER BY r.PYear, r.PMonth