SQL
x
use enwiki_p;
select page_title as "ערך", page_is_redirect as "הפניה", page_len as "גודל", ll_title as "שם בעברית"
from page join langlinks
on
(exists (select * from categorylinks
where cl_to = "Mayors_of_places_in_the_United_States"
and cl_from = page_id)
or exists (select * from categorylinks
where cl_from = page_id
and 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 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 = "Mayors_of_places_in_the_United_States")))))
or exists (select * from categorylinks
where cl_from = page_id
and 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 = "Mayors_of_places_in_the_United_States"))))
and page_namespace = 0
and page_id = ll_from
and ll_lang = "he"
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.