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
EqJjgOa8rVvsRmZL
.
Toggle Highlighting
SQL
with recursive subcats (depth, cat_title, cat_title_join) as ( select distinct 0, cl_to, cl_to from categorylinks where cl_to in ('Lists') union all select depth + 1, page_title, page_title from subcats join categorylinks on cl_to = cat_title and cl_type = 'subcat' join page on cl_from = page_id where depth < 3 ) -- select count(cat_title), count(distinct cat_title) from subcats; -- select min(depth), max(depth), cat_title, count(*) from subcats group by cat_title order by count(depth) desc limit 10; select * from subcats limit 1; /* select count(distinct page_namespace, page_title) from subcats join categorylinks on cl_to = cat_title and cl_type != 'subcat' join page on cl_from = page_id order by page_namespace; */
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...