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(DISTINCT lt.lt_id) AS total_links, COUNT(DISTINCT CASE WHEN p2.page_id IS NULL THEN lt.lt_id END) AS red_links, ROUND(COUNT(DISTINCT CASE WHEN p2.page_id IS NULL THEN lt.lt_id END) * 100.0 / COUNT(DISTINCT lt.lt_id), 2) AS red_links_percentage FROM page p JOIN categorylinks cl ON cl.cl_from = p.page_id JOIN pagelinks pl ON pl.pl_from = p.page_id JOIN linktarget lt ON lt.lt_id = pl.pl_target_id LEFT JOIN page p2 ON p2.page_namespace = lt.lt_namespace AND p2.page_title = lt.lt_title WHERE p.page_namespace = 10 AND p.page_title NOT LIKE '%/doc' AND cl.cl_to LIKE '%Навигационные_шаблоны%' AND lt.lt_namespace = 0 GROUP BY p.page_id, p.page_title HAVING COUNT(DISTINCT lt.lt_id) > 0 AND COUNT(DISTINCT CASE WHEN p2.page_id IS NULL THEN lt.lt_id END) > 0 AND COUNT(DISTINCT lt.lt_id) <= 1000 ORDER BY total_links DESC LIMIT 50;
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...