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
Turtlecrown
.
Toggle Highlighting
SQL
WITH RECURSIVE CategoryHierarchy AS ( SELECT cl_from AS category_id FROM categorylinks WHERE cl_to = 'All_articles_lacking_sources' UNION ALL SELECT cl_from AS category_id FROM categorylinks JOIN CategoryHierarchy ON cl_to = category_id ) SELECT c1.cat_title AS category, COUNT(DISTINCT cl1.cl_from) AS article_count FROM CategoryHierarchy ch JOIN categorylinks cl1 ON ch.category_id = cl1.cl_to JOIN page p1 ON cl1.cl_from = p1.page_id JOIN categorylinks cl2 ON cl1.cl_from = cl2.cl_from JOIN page p2 ON cl2.cl_from = p2.page_id JOIN category c1 ON cl1.cl_to = c1.cat_title WHERE p1.page_namespace = 0 AND p2.page_namespace = 0 GROUP BY c1.cat_title ORDER BY article_count DESC;
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...