Q&A about the site for professional linguists and others with an interest in linguistic research and theory
select Id as PostId, YEAR(Posts.CreationDate) as [Year] into #PostSet from Posts where PostTypeId = 1 and DeletionDate is null select [Year], Count(*) as Total into #YearTotals from #PostSet group by [Year] select [Year], Tags.TagName as Tag, Count(*) as Number into #YearTagNumber from #PostSet join PostTags on #PostSet.PostId = PostTags.PostId join (select * from Tags where Count >= 2000) Tags on PostTags.TagId = Tags.Id group by [Year], Tags.TagName select #YearTagNumber.[Year] as [Year], Tag, Number, Total from #YearTagNumber join #YearTotals on #YearTagNumber.[Year] = #YearTotals.[Year] order by #YearTagNumber.[Year], Tag