Most Popular Tags by Quarter

0

Please login or register to vote for this query.

(click on this box to dismiss)

Joomla

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

SELECT 
  t.TagName,
  DatePart(quarter, p.CreationDate) AS q, 
  Year(p.CreationDate) AS y, 
  COUNT(p.Id) As NumPosts,
  --SUM(p.AnswerCount) as NumAnswerCount
  SUM(CAST(p.Score AS BIGINT)) as NumAnswerCount
FROM 
  Posts p
JOIN 
  PostTags pt ON p.Id = pt.PostId
JOIN 
  Tags t ON t.Id = pt.TagId
WHERE 
  Year(p.CreationDate) >= 2020
  --AND p.LastActivityDate < '5/14/2020'
GROUP BY 
  DatePart(quarter, p.CreationDate), 
  Year(p.CreationDate), 
  t.TagName
HAVING 
   SUM(CAST(p.Score AS BIGINT)) > 1000
  --COUNT(p.Id) > 1000
ORDER BY 
  --y,
  --q, 
  NumAnswerCount DESC
  --NumPosts DESC

Enter Parameters

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