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
IKhitron
.
Toggle Highlighting
SQL
use enwiki_p; set @s = "Mayors_of_places_in_the_United_States"; select page_title as "ערך", page_is_redirect as "הפניה", page_len as "גודל", ll_title as "שם בעברית" from page join langlinks on page_namespace = 0 and page_id = ll_from and ll_lang = "he" and exists (select * from categorylinks where cl_from = page_id and (cl_to = @s or exists (select * from page as p1 where p1.page_namespace = 14 and p1.page_title = cl_to and exists (select * from categorylinks as c1 where c1.cl_from = p1.page_id and (c1.cl_to = @s or exists (select * from page as p2 where p2.page_namespace = 14 and p2.page_title = c1.cl_to and exists (select * from categorylinks as c2 where c2.cl_from = p2.page_id and c2.cl_to = @s))))))) and exists (select * from hewiki_p.page as p3 where p3.page_namespace = 0 and p3.page_title = replace(ll_title, " ", "_") and not exists (select * from hewiki_p.categorylinks as c3 where c3.cl_from = p3.page_id and c3.cl_to = "ראש_ערים_בארצות_הברית"));
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...