Monthly Total Questions by Tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Joomla Meta

Q&A about the site for Joomla! administrators, users, developers and designers

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 ='ggplot2'
  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
  DATEADD(m, DATEDIFF(m, 0, Posts.CreationDate), 0), Tags.TagName
ORDER BY
  DATEADD(m, DATEDIFF(m, 0, Posts.CreationDate), 0), Tags.TagName;

Enter Parameters

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