Find Questions Migrated Without the User

0

Please login or register to vote for this query.

(click on this box to dismiss)

Use this query to find where users have their post migrated but they never followed the question to the target site.

Amateur Radio

Q&A for amateur radio enthusiasts

SELECT
    OwnerDisplayName
  , Posts.Id AS [Post Link]
  , PostHistory.CreationDate AS [Migration Date]
  , Posts.CreationDate AS [Original Post Date]
  , SUBSTRING(
        PostHistory.Comment
      , 13
      , CHARINDEX(
            '.'
          , SUBSTRING(
                PostHistory.Comment
              , 13
              , LEN(PostHistory.Comment)
            )
        ) -1
    ) AS [Source Site]
FROM
  Posts 
JOIN
  PostHistory ON posts.Id = PostHistory.PostId
WHERE
  PostHistory.PostHistoryTypeId = 36 AND
  Posts.PostTypeId = 1 AND
  OwnerUserId IS NULL
  AND NOT EXISTS (SELECT 1 FROM Users u WHERE Displayname = posts.OwnerDisplayName and u.creationdate > posts.creationdate)
ORDER BY 1, Posts.CreationDate DESC

Enter Parameters

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