Timeline of Total Posts with [Tag]

1

Please login or register to vote for this query.

(click on this box to dismiss)

A timeline of posts (including deleted ones) which use the given tag. Doesn't count posts which had the given tag removed at some point.

Joomla Meta

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

DECLARE @TagId int = (
  SELECT
    t.Id
  FROM Tags t
  WHERE t.TagName = ##TagName:string##
)

SELECT
  DATEFROMPARTS(YEAR(v.CreationDate), MONTH(v.CreationDate), DAY(v.CreationDate)) AS [Date],
  SUM(COUNT(*)) OVER(ORDER BY DATEFROMPARTS(YEAR(v.CreationDate), MONTH(v.CreationDate), DAY(v.CreationDate)) ROWS UNBOUNDED PRECEDING) AS [Total Posts]
FROM PostTags pt
JOIN PostsWithDeleted v ON v.Id = pt.PostId
WHERE TagId = @TagId
GROUP BY DATEFROMPARTS(YEAR(v.CreationDate), MONTH(v.CreationDate), DAY(v.CreationDate))

-- TagName: Exact Name of Tag:

Enter Parameters

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