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
Sean.hoyland
.
Toggle Highlighting
SQL
set max_statement_time = 300; WITH RECURSIVE CategoryHierarchy AS ( SELECT cl_from, cl_to, cl_type, 0 AS level FROM categorylinks WHERE cl_to = 'Fatah_attacks' --replace('Fatah attacks', ' ', '_') -- Anchor member (root of the hierarchy) AND cl_type = 'subcat' UNION ALL SELECT cl.cl_from, cl.cl_to, cl.cl_type, ch.level + 1 FROM categorylinks cl INNER JOIN CategoryHierarchy ch ON cl.cl_to = ch.cl_from -- Recursive member AND cl.cl_type = 'subcat' ) -- Final query to select from the CTE SELECT cl_from, cl_to, cl_type, level FROM CategoryHierarchy WHERE level <= 1; ORDER BY level; #limit 10; #select * from actor_revision limit 50 #select * from revision_userindex limit 50 #select * from revision limit 50 #select * from comment_revision limit 10 # user_id = actor_user = 45113768 # rev_actor = actor_id = 222965530 # actor_name = user_name = 'General Blorp' # rev_comment_id = 19459854
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...