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
.
Toggle Highlighting
SQL
SET STATEMENT max_statement_time = 60 FOR SELECT pl_from_namespace, page_title FROM templatelinks TL1 JOIN page ON page_namespace = 0 AND page_id = tl_from /* Surname linked to */ JOIN pagelinks PL1 ON pl_namespace = 0 AND pl_title = page_title WHERE tl_namespace = 10 AND tl_title = "Surname" AND pl_from_namespace IN (0,6,10,14,100,828) AND page_title LIKE "An%"* AND pl_title LIKE "An%"* AND NOT EXISTS (SELECT 1 FROM categorylinks WHERE cl_from = pl_from AND cl_to = "Surnames") AND NOT EXISTS (SELECT 1 FROM templatelinks TL2 WHERE TL2.tl_from = pl_from AND TL2.tl_namespace = 10 AND TL2.tl_title = "Surname") AND NOT EXISTS (SELECT 1 FROM templatelinks TL3, page, pagelinks PL2 WHERE TL3.tl_from = PL1.pl_from AND TL3.tl_namespace = 10 AND page_namespace = 10 AND page_title = TL3.tl_title AND PL2.pl_from = page_id AND PL2.pl_namespace = PL2.pl_namespace AND PL2.pl_title = PL2.pl_title) ORDER BY pl_from_namespace, page_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...