Q&A about the site for practitioners, researchers, and students in cognitive science, psychology, neuroscience, and psychiatry
WITH results AS ( SELECT t.TagName, 'Excerpt' AS Type, t.Id, p.Body FROM Tags AS t INNER JOIN Posts AS p ON p.Id = t.ExcerptPostId WHERE p.Body LIKE '%' + ##query:string## + '%' ESCAPE '\' COLLATE sql_latin1_general_cp1_ci_ai UNION ALL SELECT t.TagName, 'Wiki', t.Id, p.Body FROM Tags AS t INNER JOIN Posts AS p ON p.Id = t.WikiPostId WHERE p.Body LIKE '%' + ##query:string## + '%' ESCAPE '\' COLLATE sql_latin1_general_cp1_ci_ai ) SELECT 'site://edit-tag-wiki/' + CAST(Id AS NVARCHAR) + '|' + TagName + ', ' + Type, body FROM results ORDER BY TagName