Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles
WITH top_posts AS(SELECT p.Id, pt.TagId FROM Posts p INNER JOIN PostTags pt ON p.Id = pt.PostId WHERE year(p.CreationDate) = '2019') SELECT Top 10 TagName, [Count] FROM Tags t INNER JOIN top_posts tp ON t.Id = tp.TagId GROUP BY t.Id, TagName, Count ORDER BY Count