Q&A about the site for expert genealogists and people interested in genealogy or family history
SELECT t.TagName, CONCAT(year(p.CreationDate), '-', month(p.CreationDate)) AS yearMonth, count(p.Id) AS postCount, sum(p.ViewCount) AS viewTotal, sum(p.AnswerCount) as answerTotal, sum(p.CommentCount) as commentTotal, sum(p.FavoriteCount) as favoriteTotal FROM Tags AS t INNER JOIN Posttags pt ON t.Id = pt.TagId INNER JOIN Posts P ON p.Id = pt.PostId WHERE t.TagName = '##TagName##' GROUP BY t.TagName, year(p.CreationDate), month(p.CreationDate) ORDER BY t.TagName, year(p.CreationDate), month(p.CreationDate)