Locate all orphan tag wikis and excerpts. Orphan tag wikis are wikis for a tag that has no question and has thus been deleted. Note that the name of the tag is not available. An excerpt is usually just below the corresponding wiki, as they are now created simultaneously. This may not be the case for older tag wikis.
Q&A for programmers
SELECT 'site://posts/' + Cast(P.Id AS VarChar(10)) + '/revisions|' + Cast(P.Id AS VarChar(10)) AS [Link], CASE p.PostTypeId WHEN 4 THEN 'excerpt' ELSE 'wiki' END AS [Type], p.Body AS [Body], p.CreationDate AS [CreationDate], p.LastEditDate AS [LastEditDate], p.LastEditorUserId AS [User Link] FROM Posts p WHERE (p.PostTypeId = 4 AND NOT EXISTS (SELECT * FROM Tags t WHERE t.ExcerptPostId = p.Id)) OR (p.PostTypeId = 5 AND NOT EXISTS (SELECT * FROM Tags t WHERE t.WikiPostId = p.Id)) ORDER BY p.Id
Error: looks like you typed in the wrong words - try again