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
Hosseinronaghi
.
Toggle Highlighting
SQL
use fawiki_p; WITH RECURSIVE Subcategories AS ( -- انتخاب زیرردههای اولیه SELECT cl_from AS category_id, p1.page_title AS category_title FROM categorylinks JOIN page p1 ON cl_from = p1.page_id WHERE cl_to = 'شهرها_در_کارولینای_جنوبی' AND p1.page_namespace = 14 AND p1.page_is_redirect = 0 AND p1.page_title NOT LIKE '%(%)%' AND p1.page_title LIKE '%,%' UNION ALL -- انتخاب زیرردههای زیرردهها بهصورت بازگشتی SELECT cl.cl_from AS category_id, p2.page_title AS category_title FROM categorylinks cl JOIN page p2 ON cl.cl_from = p2.page_id JOIN Subcategories sc ON cl.cl_to = sc.category_title WHERE p2.page_namespace = 14 AND p2.page_is_redirect = 0 AND p2.page_title NOT LIKE '%(%)%' AND p2.page_title LIKE '%,%' ) SELECT DISTINCT category_id, category_title FROM Subcategories;
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...