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
WITH template_links AS ( SELECT tl_from, tl_title, COUNT(DISTINCT pl_title) as total_links, SUM(CASE WHEN page_id IS NULL THEN 1 ELSE 0 END) as red_links FROM templatelinks LEFT JOIN page ON pl_namespace = page_namespace AND pl_title = page_title WHERE tl_namespace = 10 -- Пространство имён шаблонов AND tl_title LIKE 'Навигация%' -- Шаблоны навигации GROUP BY tl_from, tl_title ) SELECT p.page_title as template_name, tl.total_links, tl.red_links, ROUND(tl.red_links * 100.0 / tl.total_links, 2) as red_links_percentage FROM template_links tl JOIN page p ON tl.tl_from = p.page_id WHERE tl.red_links = tl.total_links -- Все ссылки красные AND tl.total_links > 0 -- Есть хотя бы одна ссылка ORDER BY tl.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...