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
Ganmatthew
.
Toggle Highlighting
SQL
WITH RECURSIVE subcategories AS ( SELECT cat_title AS category FROM categorylinks WHERE cl_to = 'WikiProject_Philippines' UNION SELECT cl2.cl_to AS category FROM categorylinks cl1 JOIN categorylinks cl2 ON cl1.cl_from = cl2.cl_from WHERE cl1.cl_to = 'WikiProject_Philippines' AND cl2.cl_to NOT IN (SELECT category FROM subcategories) ) SELECT pl_title AS Target, COUNT(page_id) AS LinkCount FROM pagelinks LEFT JOIN page ON page_namespace=0 AND page_title=pl_title WHERE pl_from IN (SELECT page_id FROM page WHERE page_namespace=0 AND page_id IN (SELECT cl_from FROM categorylinks WHERE cl_to IN (SELECT category FROM subcategories))) AND page_title IS NULL GROUP BY pl_title ORDER BY LinkCount DESC LIMIT 10;
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...