Questions, Avg. Answers Per Tag (Top Ten) (By Month)

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 *, COUNT(*) AS 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 10 Id FROM Tags 
    ORDER BY Count DESC
  )
) AS X
GROUP BY TagName, [Month]
ORDER BY [Month] ASC, TagName ASC

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results