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
Ratekreel
.
Toggle Highlighting
SQL
SELECT sc.subcategory AS subcategory, COUNT(DISTINCT p.page_id) AS file_count FROM ( SELECT subcat.page_title AS subcategory FROM categorylinks AS cl JOIN page AS subcat ON cl.cl_from = subcat.page_id WHERE cl.cl_to = "Narendra_Modi" AND subcat.page_namespace = 14 ) AS sc JOIN categorylinks AS cl2 ON sc.subcategory = cl2.cl_to JOIN page AS p ON cl2.cl_from = p.page_id LEFT JOIN page_props AS pp ON p.page_id = pp.pp_page AND pp.pp_propname = "wikibase_item" WHERE p.page_namespace = 6 AND pp.pp_value IS NULL GROUP BY sc.subcategory ORDER BY file_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...