Total Questions by Tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT
  DATEADD(m, DATEDIFF(m, 0, Posts.CreationDate), 0) AS Month,
  Tags.TagName AS Tag ,
  Count(*) AS Questions
FROM
  Tags
  LEFT JOIN PostTags ON PostTags.TagId = Tags.Id
  LEFT JOIN Posts ON Posts.Id = PostTags.PostId
  LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId
WHERE
  Tags.TagName ='amazon-web-services'
  AND PostTypes.Name = 'Question'
  AND CreationDate >= DATEADD(m, DATEDIFF(m, 0, GETDATE())-50,0)
  AND CreationDate < DATEADD(m, DATEDIFF(m, 0, GETDATE()), 0)
GROUP BY
  Tags.TagName, DATEADD(m, DATEDIFF(m, 0, Posts.CreationDate), 0)
ORDER BY
  Tags.TagName, DATEADD(m, DATEDIFF(m, 0, Posts.CreationDate), 0);

Enter Parameters

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