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
Nemo bis
.
Looks for first-level subpages of portals which were left without incoming links or transclusions, probably after being superseded by newer templates.
Toggle Highlighting
SQL
USE enwiki_p; SELECT page_title, count(tl_from) AS transclusions, COUNT(pl_from) AS links -- , COUNT(tl_from) FROM page LEFT JOIN templatelinks ON page_title = tl_title AND tl_namespace = 100 AND tl_from_namespace = 100 JOIN pagelinks ON page_title = pl_title AND pl_from_namespace = 100 AND pl_namespace = 100 WHERE page_namespace = 100 -- Deeper levels of subpages may be transcluded only in rotation: AND page_title RLIKE "^[^/]+/[^/]+$" -- {{Random portal component}} embeds sub-subpages but only links the subpage GROUP BY page_title -- Otherwise a first-level subpage without any transclusion is suspect: HAVING transclusions = 0; /* WHERE SUBSTRING_INDEX(page_title, "/", 1) IN ( SELECT page_title FROM page JOIN templatelinks ON tl_from = page_id AND page_namespace = 100 AND tl_title LIKE "Transclude_%_excerpt" AND LOCATE("/", page_title) = 0 ) */ ;
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...