[ruby-on-rails] Questions per month

0

Please login or register to vote for this query.

(click on this box to dismiss)

How many questions per month does each tag in the top 10 tags get

Stack Overflow

Q&A for programmers

SELECT *, 
       Count(*) 
FROM   (SELECT Cast(Cast(Datepart(yyyy, creationdate) AS VARCHAR) 
                    + '-' 
                    + Cast(Datepart(mm, creationdate) AS VARCHAR) 
                    + '-01' AS DATETIME) [Month], 
               t.tagname 
        FROM   posts p 
               JOIN posttags pt 
                 ON pt.postid = p.id 
               JOIN tags t 
                 ON t.id = pt.tagid 
        WHERE  tagid IN (SELECT TOP 1 id 
                         FROM   tags 
                         WHERE  tagname = 'mean-stack' 
                         ORDER  BY count DESC)) AS X 
GROUP  BY tagname, 
          [month] 
ORDER  BY [month] ASC

Enter Parameters

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