Q&A about the site for students, teachers, and linguists wanting to discuss the finer points of the Japanese language
SELECT YEAR(p.CreationDate) AS year, t.TagName AS tag, COUNT(*) AS number, (SELECT COUNT(*) FROM Posts WHERE PostTypeId = 1 AND YEAR(CreationDate) = YEAR(p.CreationDate)) AS year_total FROM Posts p JOIN PostTags pt ON p.Id = pt.PostId JOIN Tags t ON pt.TagId = t.Id WHERE p.PostTypeId = 1 -- Only include questions GROUP BY YEAR(p.CreationDate), t.TagName ORDER BY year, number DESC;