SQL
x
-- Rationale for this query: there seem to be a lot of incorrect links of this type, probably caused by
-- mass creation at scale. Not sure whether this will turn out to be practical.
SELECT DISTINCT sourcetalkpage.page_title
FROM page talkpage
INNER JOIN categorylinks cat1 ON cat1.cl_from = talkpage.page_id
INNER JOIN categorylinks cat2 ON cat2.cl_from = talkpage.page_id
INNER JOIN pagelinks ON pagelinks.pl_title = talkpage.page_title
INNER JOIN page sourcemainpage ON sourcemainpage.page_id = pagelinks.pl_from
INNER JOIN page sourcetalkpage ON sourcetalkpage.page_title = sourcemainpage.page_title
WHERE cat1.cl_to = "WikiProject_Biography_articles"
AND cat2.cl_to = "Stub-Class_football_articles"
AND talkpage.page_namespace = 1
AND pagelinks.pl_namespace = 0
AND pagelinks.pl_from_namespace = 0
AND sourcetalkpage.page_namespace = 1
AND sourcemainpage.page_is_redirect = 0
AND "WikiProject_Football_articles" NOT IN (
SELECT cat3.cl_to FROM categorylinks cat3 WHERE cat3.cl_from = sourcetalkpage.page_id
)
AND "All_set_index_articles" NOT IN (
SELECT cat4.cl_to FROM categorylinks cat4 WHERE cat4.cl_from = sourcemainpage.page_id
)
AND 'disambiguation' NOT IN (
SELECT pp_propname FROM page_props WHERE page_props.pp_page = sourcemainpage.page_id
)
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.