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
RaymondYee
.
borrowing approach from http://stackoverflow.com/a/28366310/7782 --> this query didn't recurse -- just grabbed the first level of descendents.
Toggle Highlighting
SQL
SELECT GROUP_CONCAT(lv SEPARATOR ',') FROM ( SELECT @pv:= ( SELECT GROUP_CONCAT(from_id SEPARATOR ',') FROM ( SELECT cl_from as from_id, p1.page_title as from_title, p2.page_id as to_id, cl_to as to_title, cl_type FROM categorylinks cl JOIN page p1 JOIN page p2 ON cl.cl_from = p1.page_id AND cl.cl_to = p2.page_title ) AS Folder WHERE to_id IN (@pv) ) AS lv FROM ( SELECT cl_from as from_id, p1.page_title as from_title, p2.page_id as to_id, cl_to as to_title, cl_type FROM categorylinks cl JOIN page p1 JOIN page p2 ON cl.cl_from = p1.page_id AND cl.cl_to = p2.page_title ) AS Folder2 JOIN (SELECT @pv:=(SELECT page_id FROM page WHERE page_title = 'Johann_Sebastian_Bach' AND page_namespace = 14)) tmp WHERE to_id IN (@pv) ) a;
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...