Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
All main space pages with count of their sub pages
by
Arjunaraoc
This query is marked as a draft
This query has been published
by
Arjunaraoc
.
Useful for knowing the the number of pages in all books when the chapter pages are done. Does not include redirects and the root page
Toggle Highlighting
SQL
use tewikisource_p; SELECT s.page_id, s.numpages, (pl_namespace=106) as IndexFlag FROM(SELECT page_id, SUBSTRING_INDEX(page_title,'/',1) as page_prefix, COUNT(*) as numpages FROM page WHERE page_namespace=0 and page_title LIKE '%/%' and page_is_redirect=0 GROUP BY page_prefix LIMIT 2000;) as s JOIN pagelinks ON pl_from = s.page_id ORDER BY page_id;
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...