Tag counts over the months

0

Please login or register to vote for this query.

(click on this box to dismiss)

Physical Fitness Meta

Q&A about the site for physical fitness professionals, athletes, trainers, and those providing health-related needs

DECLARE @Tag varchar(35) = ##Tag##

SELECT --TOP 1
  format(CreationDate,'yyyy.MM') AS CreationMonth,
  COUNT(*) as TagCount
FROM
  Tags
  JOIN PostTags on Tags.Id = PostTags.TagId
  JOIN Posts on Posts.Id = PostTags.PostId
WHERE
  TagName IN (@Tag)
GROUP BY
  format(CreationDate,'yyyy.MM')
ORDER BY
  format(CreationDate,'yyyy.MM')

Enter Parameters

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