SQL
x
use hewiki_p;
select distinct(concat('# [[', replace(p1.page_title, "_", " "), ']]')) as 'ערך'
from page as p1 join pagelinks on p1.page_id = pl_from
join page as p2 on pl_title = p2.page_title
left join redirect on p2.page_id = rd_from
left join categorylinks on p2.page_id = categorylinks.cl_from
where p1.page_namespace = 0
and not exists
(select * from categorylinks as cl1
where cl1.cl_from = p1.page_id
and cl1.cl_to = 'פירושונים')
and not p2.page_title like "%_(פירושונים)"
and not exists
(select * from templatelinks
where tl_from = p1.page_id
and tl_title = "פירושון")
and ((pl_namespace = 0
and rd_namespace = 0
and rd_title in
(select page_title
from page join categorylinks
on page_namespace = 0
and page_id = cl_from
and cl_to = 'פירושונים')
and p1.page_is_redirect = 0) or
(pl_namespace = p2.page_namespace
and categorylinks.cl_to = 'פירושונים'
and p1.page_is_redirect = 0))
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.