Preguntas y respuestas sobre el sitio para programadores y profesionales de la informática
create table #tags (Date date, TagName nvarchar (35), Count int); insert into #tags select DATEADD(QUARTER , DATEDIFF(QUARTER , 0, CreationDate), 0) AS [QUARTER], 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 > '2011-01-01' AND (t.TagName like 'firebase%' or t.TagName LIKE 'google-cloud-%' or t.TagName LIKE 'amazon-%' or t.tagName LIKE '%azure%' or t.tagName LIKE '%aws%') group by t.TagName, DATEADD(QUARTER , DATEDIFF(QUARTER , 0, CreationDate), 0) order by [QUARTER] 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;