SQL
AخA
USE fawiki_p;
SELECT DISTINCT CONCAT ('# [[',REPLACE(page_title,'_',' '),']]')
FROM page
WHERE page_namespace=0
AND page_is_redirect=0
AND page_title LIKE "دهستان\_%"
AND page_title NOT LIKE "دهستان_(%"
AND page_id NOT IN (
SELECT cl_from
FROM categorylinks
WHERE cl_to LIKE "مقاله•های_خرد_جغرافیای_یمن"
OR cl_to LIKE "مقاله•های_خرد_استونی"
OR cl_to LIKE "%اسپانیا%"
OR cl_to LIKE "%چین%"
)
AND page_id NOT IN (
SELECT pp_page
FROM page_props
WHERE pp_propname = 'disambiguation'
)
AND page_title NOT IN (
SELECT pl_title
FROM pagelinks
WHERE pl_from = 4092254 # ویکی•پدیا:ویکی•پروژه تقسیمات کشوری ایران/فاز دوم/تقسیمات کشوری ۱۳۹۵
)
AND page_title NOT IN (
SELECT rd_title
FROM pagelinks JOIN page ON pl_title = page_title JOIN redirect ON rd_from = page_id
WHERE pl_from = 4092254 # ویکی•پدیا:ویکی•پروژه تقسیمات کشوری ایران/فاز دوم/تقسیمات کشوری ۱۳۹۵
)
ORDER BY 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.
All SQL code is licensed under CC0 License.