question count per month

0

Please login or register to vote for this query.

(click on this box to dismiss)

Drupal Answers Meta

Q&A about the site for Drupal developers and administrators

SELECT
  DATEADD(mm, (Year(Posts.CreationDate) - 1900) * 12 + Month(Posts.CreationDate) - 1, 0) AS Month,
  'ALL' as TagName,
  COUNT(1) 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
  
  Year(Posts.CreationDate) > 2007
  AND
  
  PostTypes.Name = 'Question'
  
GROUP BY Year(Posts.CreationDate), Month(Posts.CreationDate)
ORDER BY Year(Posts.CreationDate), Month(Posts.CreationDate)

Enter Parameters

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