Pulls a list of all (non-empty) orphaned tag wiki-excerpt pairs. Tag wikis are orphaned when their parent tag is removed or synonymized. No tag name is associated with these wikis anymore, since the tag itself was removed; this makes them difficult to catalogue, as no tag name is associated with them in SEDE.
Q&A for science fiction and fantasy enthusiasts
CASE WHEN excerpt.Id IS NOT NULL
THEN CONCAT('site://posts/', excerpt.Id, '/revisions|Excerpt Link')
END AS [Exrpt. Link],
CASE WHEN excerpt.Body IS NOT NULL
ELSE '[This excerpt does not exist]'
END AS [Exrpt. Body],
CONCAT('site://posts/', wiki.Id, '/revisions|Wiki Link') AS [Wiki Link],
wiki.Body AS [Wiki Body],
wiki.CreationDate AS [Wiki Creation Date]
FROM Posts wiki
LEFT JOIN Posts excerpt ON excerpt.Id = (wiki.Id + 1) AND excerpt.PostTypeId = 4
LEFT JOIN Tags t ON t.WikiPostId = wiki.Id
WHERE wiki.PostTypeId = 5 -- Limit posts to tag wikis only.
AND t.Id IS NULL -- Only pull wikis where no tag is associated.
AND (wiki.Body <> '' -- Omit wiki/ excerpt pairs where both are empty,
OR excerpt.Body <> '' -- since there's nothing to read.
ORDER BY wiki.CreationDate