Q&A about the site for people interested in improving and participating in the patent system
create table #tags (Date date, TagName nvarchar (35), Count int); insert into #tags select DATEADD(WEEK, DATEDIFF(WEEK, 0, CreationDate), 0) AS [WEEK], t.TagName, count(*) as Count from Posts p join PostTags pt on pt.PostId = p.Id join Tags t on t.Id = pt.TagId where p.CreationDate > '2019-06-01' AND (t.TagName like 'firebase-%' or t.TagName = 'google-cloud-functions' or t.TagName = 'google-cloud-firestore') group by t.TagName, DATEADD(WEEK, DATEDIFF(WEEK, 0, CreationDate), 0) order by [WEEK] desc; select * from #tags where TagName in ( select TOP 20 TagName from #tags where Date in ( select TOP 20 Date from #tags order by Date desc ) order by Count desc ) order by [Date] desc;