Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
Stub-class critically endangered species articles
by
Chlod
This query is marked as a draft
This query has been published
by
Chlod
.
A list of extinct in the wild species with stub articles.
Toggle Highlighting
SQL
# Category of the mainspace article SET @MAIN_CAT = REPLACE( ## vv CHANGE ME vv "IUCN Red List extinct in the wild species" ## ^^ CHANGE ME ^^ , " ", "_"); # Class category SET @CLASS_CAT = REPLACE( ## vv CHANGE ME vv "Stub-Class articles" ## ^^ CHANGE ME ^^ , " ", "_"); # GO SELECT REPLACE(p1.page_title, "_", " ") AS `Page title`, REPLACE(GROUP_CONCAT(cl2.cl_to SEPARATOR ", "), "_", " ") AS "Stub category", (SELECT COUNT(*) FROM pagelinks pl WHERE pl.pl_namespace = 0 AND pl_title = p1.page_title) AS `Inbound links`, p1.page_len AS "Length" FROM categorylinks cl1 LEFT JOIN page p1 ON cl1.cl_from = p1.page_id INNER JOIN page p2 ON p2.page_title = p1.page_title AND p2.page_namespace = (p1.page_namespace + 1) INNER JOIN categorylinks cl2 ON cl2.cl_from = p2.page_id AND (( SELECT COUNT(*) FROM categorylinks cls2 WHERE cls2.cl_to = @CLASS_CAT AND cls2.cl_from = ( SELECT ps2.page_id FROM page ps2 WHERE ps2.page_title = cl2.cl_to AND ps2.page_namespace = 14 # Category ) ) > 0) WHERE cl1.cl_to = @MAIN_CAT GROUP BY `Page title` ORDER BY `Inbound links` 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...