Q&A about the site for information security professionals
create table #tags (Date date, TagName nvarchar (35), Count int, TotalCount int); insert into #tags select DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) AS [MONTH], t.TagName, count(*) as Count, (select count(*) from Posts) as TotalCount from Posts p join PostTags pt on pt.PostId = p.Id join Tags t on t.Id = pt.TagId where p.CreationDate > '2016-01-01' AND (t.TagName = 'google-cloud-firestore' or t.TagName = 'mongodb' or t.TagName = 'pandas' or t.TagName = 'postgresql') group by t.TagName, DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) order by [MONTH] desc; select * from #tags where TagName in ( select TOP 30 TagName from #tags where Date in ( select TOP 30 Date from #tags order by Date desc ) order by Count desc ) order by [Date] desc;