Q&A for people interested in conceptual questions about life and challenges in a world where "cognitive" functions can be mimicked in purely digital environment
Declare @Year int , @week int set @year = ##year:int## set @week = ##month:int## SELECT TOP 100 t.tagname, Count(p.id) k FROM posts p INNER JOIN posttags pt ON p.id = pt.postid INNER JOIN tags t ON pt.tagid = t.id WHERE Year(p.creationdate) = @Year AND Datepart(week, p.creationdate) = @Week GROUP BY t.tagname ORDER BY Count(p.id) DESC