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 Pt.page_title, pl_from_namespace, Pf.page_title FROM templatelinks /* from surname article to {{Surname}} */ JOIN page Pt ON Pt.page_namespace = 0 AND Pt.page_id = tl_from /* Surname article wikilinked to */ JOIN pagelinks PL ON pl_namespace = 0 AND pl_title = Pt.page_title /* Wikilink from article to surname */ JOIN page Pf ON Pf.page_id = PL.pl_from /* Page wikilinked from */ WHERE tl_namespace = 10 AND tl_title = "Surname" AND pl_from_namespace IN (0,6,10,14,100,828) /* Main, File, Template, Category, Portal, Module */ AND tl_from = 62283316 AND Pt.page_title LIKE "Antonietti" AND pl_title LIKE "Antonietti" AND NOT EXISTS (SELECT 1 FROM categorylinks WHERE cl_from = PL.pl_from AND cl_to = "Surnames") /* Page linked from is not another surname... */ AND NOT EXISTS (SELECT 1 FROM templatelinks WHERE tl_from = PL.pl_from AND tl_namespace = 10 AND tl_title = "Surname") AND NOT EXISTS (SELECT 1 FROM templatelinks WHERE tl_from = PL.pl_from AND tl_namespace = 10 AND tl_title = "All_disambiguation_pages") /* nor dab */ /*AND NOT EXISTS (SELECT 1 FROM templatelinks JOIN page ON page_namespace = 10 AND page_title = tl_title JOIN pagelinks ON pl_from = page_id AND pl_namespace = 0 AND pl_title = Pt.page_title WHERE tl_from = PL.pl_from AND tl_namespace = 10)*/ ORDER BY Pt.page_title, pl_from_namespace, Pf.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...