Tag edits which do not change tags

1

Please login or register to vote for this query.

(click on this box to dismiss)

Cognitive Sciences Meta

Q&A about the site for practitioners, researchers, and students in cognitive science, psychology, neuroscience, and psychiatry

; with tagedits_cte as
(
SELECT
Ph1.PostId AS pid,
Ph1.id AS phid, 
MIN(ph2.Id) as MinId
  FROM PostHistory ph1 INNER JOIN PostHistory ph2 ON ph2.PostId=ph1.PostId
  WHERE (ph2.Id>ph1.Id) 
   AND (ph1.PostHistoryTypeId in (3,6,9))
   AND (ph2.PostHistoryTypeId in (3,6,9))
---only tag edits
GROUP BY ph1.PostId, Ph1.Id
)

SELECT
  t.pid AS [Post Link],
  'site://posts/' + CAST(t.pid AS varchar)+'/revisions' AS [Revision History],
  ph1.Text AS Tags, ph2.CreationDate, ph2.Comment
FROM tagedits_cte t INNER JOIN PostHistory ph1 ON t.phid=ph1.id
  INNER JOIN PostHistory ph2 ON t.minid=ph2.id
WHERE ph1.Text=ph2.Text
ORDER BY pid

Enter Parameters

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