Tag popularity history

0

Please login or register to vote for this query.

(click on this box to dismiss)

elementary OS Meta

Q&A about the site for developers and users of elementary OS and applications

DECLARE @TagId INT;
SELECT @TagId = Id
FROM Tags
WHERE TagName=##TagName:string##;

SELECT
  DATEFROMPARTS(
    DATEPART(yyyy, Posts.CreationDate),
    DATEPART(mm, Posts.CreationDate),
    1) AS Month,
  100.0 * COUNT(PostTags.PostId) / COUNT(*) AS Pct
FROM Posts
LEFT JOIN PostTags ON PostTags.PostId = Posts.Id AND PostTags.TagId = @TagId
WHERE Posts.PostTypeId = 1
GROUP BY DATEFROMPARTS(
  DATEPART(yyyy, Posts.CreationDate),
  DATEPART(mm, Posts.CreationDate),
  1)
ORDER BY Month;

Enter Parameters

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