Monthly tag upvote Trends (# Upvotes per tag per Month)

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

SELECT
  DATEADD(mm, (Year(Votes.CreationDate) - 1900) * 12 + Month(Votes.CreationDate) - 1, 0) AS Month,
  Tags.TagName,
  cast(COUNT(*) as decimal)/20.0 AS Upvotes
 -- AVG(Score) AS Scores

FROM Tags
  LEFT JOIN PostTags ON PostTags.TagId = Tags.Id
  --LEFT JOIN Posts ON Posts.Id = PostTags.PostId
  LEFT JOIN Votes ON Votes.PostId = PostTags.PostId
  --LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId

WHERE
  Tags.TagName IN ('angular','reactjs', 'vue.js') --AND
  
  --PostTypes.Name = 'Question' 
  
  -- Exclude the current month
  --Posts.CreationDate < DATEADD(month, DATEDIFF(month, 0, GETDATE()), 0)

GROUP BY
  Year(Votes.CreationDate), Month(Votes.CreationDate), Tags.TagName

ORDER BY
  Year(Votes.CreationDate), Month(Votes.CreationDate), Tags.TagName

Enter Parameters

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