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
Chlod
.
A list of critically endangered species with stub articles. You can use this query as a template for building your own niche-specific + class-specific searches.
Toggle Highlighting
SQL
# Category of the mainspace article SET @MAIN_CAT = REPLACE("IUCN Red List critically endangered species", " ", "_"); # Class category SET @CLASS_CAT = REPLACE("Stub-Class articles", " ", "_"); # 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` 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...