Top tags for a given week.

0

Please login or register to vote for this query.

(click on this box to dismiss)

Movies and TV Meta

Q&A about the site for movie and tv enthusiasts

Declare @Year int ,
        @week int

set @year = ##year:int##
set @week = ##month:int##

SELECT TOP 100 t.tagname, 
               Year(p.creationdate)           yr, 
               Datepart(week, p.creationdate) week, 
               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 
GROUP  BY t.tagname, 
          Year(p.creationdate), 
          Datepart(week, p.creationdate) 
ORDER  BY Count(p.id) DESC

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results