Questions where tag display order will differ from inline editor / history.

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

WITH 

TagHistory AS (
  SELECT 
    * 
  FROM 
    PostHistory 
  WHERE 
    PostHistoryTypeId IN (3, 6, 9) -- Initial/Edit/Rollback Tags
),

MostRecentTagHistory AS (
  SELECT 
    h1.PostId, 
    h1.Text
  FROM 
    TagHistory h1 LEFT JOIN TagHistory h2 ON
      (h1.PostId = h2.PostId AND h1.CreationDate < h2.CreationDate)
  WHERE 
    h2.CreationDate IS NULL
)

SELECT TOP 100            -- If you want to remove top limit, then...
  p.Id AS [Post Link],    -- ...you have to remove [Post Link] too. Blame Tim Stone.
  p.Tags AS 'Tags in post',
  et.Text AS 'Tags in revision',
  p.CreationDate
FROM 
  Posts p INNER JOIN MostRecentTagHistory et ON p.Id = et.PostId
WHERE
  p.Tags <> et.Text

Enter Parameters

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