Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
This query is marked as a draft
This query has been published
by
Certes
.
Pages called Foo (bar) which are widely read, where Foo is (or redirects to) a different article. There may be a case for moving Foo and putting a dab, or even Foo (bar), at that title. There may also be links to fix where an editor has erroneously linked to the base name but intended the qualified topic.
Toggle Highlighting
SQL
SELECT pl_title AS Qualified, Pb.page_title as Base FROM pagelinks JOIN page Pq ON Pq.page_namespace=0 AND Pq.page_title=pl_title JOIN page Pb ON Pb.page_namespace=0 AND Pb.page_title=SUBSTRING_INDEX(pl_title, "_(", 1) WHERE pl_from = (SELECT Pr.page_id FROM page Pr WHERE Pr.page_namespace=2 AND Pr.page_title="HostBot/Top_1000_report") AND pl_namespace=0 AND pl_title REGEXP "_\\((?!series)" AND NOT EXISTS (SELECT 1 FROM page_props WHERE pp_page=Pb.page_id AND pp_propname = "disambiguation") /* Foo is a dab */ AND NOT EXISTS (SELECT 1 FROM redirect /* Foo redirects to Foo (bar) */ WHERE rd_from=Pb.page_id AND rd_namespace=0 AND rd_title=pl_title) AND NOT EXISTS (SELECT 1 FROM redirect, page Pd, page_props /* Foo redirects to any dab */ WHERE rd_from=Pb.page_id AND rd_namespace=0 AND Pd.page_namespace=0 AND Pd.page_title=rd_title AND pp_page=Pd.page_id AND pp_propname = "disambiguation") AND NOT EXISTS (SELECT 1 FROM redirect /* Foo (bar) redirects to Foo */ WHERE rd_from=Pq.page_id AND rd_title=page_title AND rd_namespace=0) AND NOT EXISTS (SELECT 1 FROM redirect Rb, redirect Rq /* Foo and Foo (bar) redirect to same target */ WHERE Rb.rd_namespace=0 AND Rb.rd_from=Pb.page_id AND Rq.rd_namespace=0 AND Rq.rd_from=Pq.page_id AND Rq.rd_title=Rb.rd_title) ORDER BY Qualified
By running queries you agree to the
Cloud Services Terms of Use
and you irrevocably agree to release your SQL under
CC0 License
.
Submit Query
Stop Query
All SQL code is licensed under
CC0 License
.
Checking query status...