Q&A about the site for professional and independent game developers
SELECT DATEPART(YEAR, p.CreationDate) AS Year, DATEPART(MONTH, p.CreationDate) AS Month, t.TagName, SUM(p.ViewCount) AS TotalViews FROM Posts p JOIN PostTags pt ON p.Id = pt.PostId JOIN Tags t ON pt.TagId = t.Id WHERE t.TagName IN ('postgresql', 'sql-server') GROUP BY DATEPART(YEAR, p.CreationDate), DATEPART(MONTH, p.CreationDate), t.TagName ORDER BY Year, Month, t.TagName;