Number of removals of the given tag per month

1

Please login or register to vote for this query.

(click on this box to dismiss)

Italian Language Meta

Q&A about the site for students, teachers, and linguists wanting to discuss the finer points of the Italian language

;  with revisions_cte as
(
SELECT
DISTINCT p.Id AS pid, ph1.Id AS phId
FROM PostHistory ph1 INNER JOIN Posts p ON ph1.PostId=p.Id
WHERE ph1.PostHistoryTypeId in (3,6,9)
  and ph1.Text Like '%<##tagName?abstract-algebra##>%'
  and NOT(p.Tags Like '%<##tagName##>%')
), firstrev_cte AS
(SELECT
  pid, MIN(ph2.Id) as MinId
FROM revisions_cte INNER JOIN PostHistory ph2 ON ph2.PostId=pid
  WHERE (ph2.Id>phId)
   AND ph2.PostHistoryTypeId in (3,6,9)
   AND NOT(ph2.Text Like '%<##tagName##>%')
GROUP BY pid
)

SELECT
  eomonth(PostHistory.CreationDate),
  COUNT(*) AS Count
  FROM firstrev_cte INNER JOIN PostHistory ON firstrev_cte.MinId=PostHistory.Id
GROUP BY eomonth(PostHistory.CreationDate)
ORDER BY eomonth(PostHistory.CreationDate)

Enter Parameters

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