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
Solidest
.
Toggle Highlighting
SQL
SELECT p.page_title AS template_name, COUNT(*) AS total_links, SUM(CASE WHEN p2.page_id IS NULL THEN 1 ELSE 0 END) AS red_links, ROUND(SUM(CASE WHEN p2.page_id IS NULL THEN 1 ELSE 0 END) * 100.0 / COUNT(*), 2) AS red_links_percentage FROM templatelinks tl JOIN page p ON tl.tl_from = p.page_id LEFT JOIN pagelinks pl ON pl.pl_from = tl.tl_from LEFT JOIN page p2 ON p2.page_id = pl.pl_target_id -- Проверяем существование страницы WHERE tl.tl_from_namespace = 10 -- Пространство имён шаблонов AND p.page_title NOT LIKE '%/doc' -- Исключаем шаблоны с "/doc" в названии GROUP BY p.page_id, p.page_title HAVING total_links > 0 AND red_links = total_links ORDER BY total_links DESC LIMIT 100;
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...