SQL
AخA
SELECT Pf.page_namespace as "Fns", Pf.page_title AS "FromTitle", Pt.page_namespace as "Tns", Pt.page_title AS "ToTitle"
FROM linktarget
JOIN templatelinks ON tl_target_id=lt_id
JOIN redirect ON rd_from=tl_from
JOIN page Pt ON Pt.page_namespace=rd_namespace AND Pt.page_title=rd_title
JOIN page Pf ON Pf.page_id=tl_from
WHERE lt_namespace=10 AND lt_title="R_to_disambiguation_page"
AND NOT EXISTS (SELECT 1 FROM categorylinks WHERE cl_from=Pt.page_id
AND cl_to REGEXP "disambiguation_pages|[Gg]iven_names|[Ss]urnames|[Ss]et_index_articles|[Ll]ists")
ORDER BY Fns, Tns, FromTitle, ToTitle
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.