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
Matěj Suchánek
.
Toggle Highlighting
SQL
USE cswiki_p; SELECT CONCAT("Šablona:",SUBSTRING_INDEX(templates.page_title, '/', 1)), GROUP_CONCAT(DISTINCT pl_title SEPARATOR ", ") AS disambigs, COUNT(DISTINCT tl_from) AS uses FROM pagelinks AS links JOIN page AS pages ON pages.page_title = pl_title AND pages.page_namespace = pl_namespace JOIN (SELECT * FROM page_props WHERE pp_propname = "disambiguation") AS disambigs ON pp_page = pages.page_id JOIN page AS templates ON templates.page_id = pl_from LEFT JOIN templatelinks AS uses ON uses.tl_title = templates.page_title AND uses.tl_namespace = templates.page_namespace GROUP BY pl_from, SUBSTRING_INDEX(templates.page_title, '/', 1) ORDER BY COUNT(DISTINCT pl_title) DESC, uses DESC, templates.page_title;
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...