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
.
List FOO (gene) articles which are not linked directly or indirectly to the corresponding FOO article.
Toggle Highlighting
SQL
SET STATEMENT max_statement_time = 120 FOR SELECT Pg.page_title FROM page Pg, page Pb WHERE Pg.page_namespace=0 AND Pg.page_title LIKE 'A%_(gene)' AND Pb.page_namespace=0 AND Pb.page_title=CONCAT(SUBSTR(Pg.page_title, 1, CHAR_LENGTH(Pg.page_title)-7),"") AND NOT EXISTS ( -- Not a redirect FOO (gene) → FOO SELECT 1 FROM redirect WHERE rd_from=Pg.page_id AND rd_namespace=0 AND rd_title=Pb.page_title) AND NOT EXISTS ( -- No wikilink from FOO to FOO (gene) SELECT 1 FROM pagelinks WHERE pl_from=Pb.page_id AND pl_from_namespace=0 AND pl_namespace=0 AND pl_title=Pg.page_title) AND NOT EXISTS ( -- No wikilink from FOO (disambiguation) to FOO (gene) SELECT 1 FROM page Pd, pagelinks WHERE Pd.page_namespace=0 AND Pd.page_title=CONCAT(SUBSTR(Pg.page_title, 1, CHAR_LENGTH(Pg.page_title)-7),"_(disambiguation)") AND pl_from=Pd.page_id AND pl_from_namespace=0 AND pl_namespace=0 AND pl_title=Pg.page_title) AND NOT EXISTS ( -- No wikilink from FOO to a redirect to FOO (gene) SELECT 1 FROM redirect, pagelinks WHERE rd_from=Pb.page_id AND rd_namespace=0 AND pl_from=Pb.page_id AND pl_from_namespace=0 AND pl_namespace=0 AND pl_title=rd_title) AND NOT EXISTS ( -- No wikilink from FOO (disambiguation) to a redirect to FOO (gene) SELECT 1 FROM page Pdr, redirect, pagelinks WHERE Pdr.page_namespace=0 AND Pdr.page_title=CONCAT(SUBSTR(Pg.page_title, 1, CHAR_LENGTH(Pg.page_title)-7),"_(disambiguation)") AND rd_from=Pdr.page_id AND rd_namespace=0 AND pl_from=Pdr.page_id AND pl_from_namespace=0 AND pl_namespace=0 AND pl_title=rd_title)/* AND NOT EXISTS ( -- No wikilink from FOO to the target of redirect FOO (gene) SELECT 1 FROM page Pbr, redirect, pagelinks WHERE Pbr.page_namespace=0 AND Pbr.page_title=Pb.page_title AND rd_from=Pg.page_id AND rd_namespace=0 AND pl_from=Pbr.page_id AND pl_from_namespace=0 AND pl_namespace=0 AND pl_title=rd_title) AND NOT EXISTS ( -- No wikilink from FOO (disambiguation) to the target of redirect FOO (gene) SELECT 1 FROM page Pdr, redirect, pagelinks WHERE Pdr.page_namespace=0 AND Pdr.page_title=CONCAT(SUBSTR(Pg.page_title, 1, CHAR_LENGTH(Pg.page_title)-7),"_(disambiguation)") AND rd_from=Pdr.page_id AND rd_namespace=0 AND pl_from=Pdr.page_id AND pl_from_namespace=0 AND pl_namespace=0 AND pl_title=rd_title)*/
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...