Q&A for pro webmasters
-- Enter Query Title -- Enter Query Description set nocount on -- Interesting Questions for a Tag in the last N days declare @latest datetime select @latest = dateadd(d, -7, CreationDate) from Posts where Id = (select max(Id) from Posts); select top 20 TagName, Count(*) as PostCount from Tags inner join PostTags on Tags.Id = PostTags.TagId inner join Posts on PostTags.PostId = Posts.Id where @latest <= Posts.CreationDate group by Tagname order by SUM(7*24*60 + datediff(n, CreationDate, @latest)) DESC;