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
with recursive CategoryHierarchy as ( select cl_from, cl_to, cl_type, page_id, page_title, 0 as level from categorylinks join page on cl_from = page_id where cl_to = "Fatah_attacks" and cl_type = 'subcat' union select c.cl_from, c.cl_to, c.cl_type, p.page_id, p.page_title, ch.level + 1 from categorylinks c join page p on c.cl_from = p.page_id join CategoryHierarchy ch on c.cl_to = ch.page_title -- Recursive where c.cl_type = 'subcat' ) select cl_from, cl_to, cl_type, page_id, page_title, level from CategoryHierarchy where level <= 4 # cat_id = 249081020 for Fatah_attacks #select page_id from page where page_title = 'Fatah_attacks' and page_namespace = 0; # categorylinks.pl_from = page.page_id of child # categorylinks.pl_to = page.page_title of parent #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...