SELECT YEAR(p.CreationDate) AS [Year], MONTH(p.CreationD...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

SELECT YEAR(p.CreationDate)  AS [Year],
       MONTH(p.CreationDate) AS [Month],
       DAY(p.CreationDate)   AS [Day],
       COUNT(*)              AS [QuestionsAskedToday],
       SUM(COUNT(*)) OVER () AS [Total]
FROM   Posts p
       INNER JOIN PostTags pt
         ON p.id = pt.postid
       INNER JOIN Tags t
         ON t.id = pt.tagid
WHERE  t.tagname = 'android'
       AND p.CreationDate > '2011-01-01 00:00:00'
GROUP  BY YEAR(p.CreationDate),
          MONTH(p.CreationDate),
          DAY(p.CreationDate)  
ORDER  BY YEAR(p.CreationDate),
          MONTH(p.CreationDate) DESC,
          DAY(p.CreationDate) DESC            

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached