Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
Templates linking to disambiguations in cswiki
by
Matěj Suchánek
This query is marked as a draft
This query has been published
by
FShbib
.
Toggle Highlighting
SQL
USE arwiki_p; SELECT CONCAT('قالب:',SUBSTRING_INDEX(templates.page_title, '/', 1)), GROUP_CONCAT(DISTINCT pl_title SEPARATOR ", ") AS disambigs, COUNT(DISTINCT tl_from) AS uses FROM (SELECT * FROM pagelinks WHERE pl_from_namespace = 10 AND pl_namespace = 0) 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 AND templates.page_namespace = pl_from_namespace LEFT JOIN (SELECT * FROM templatelinks WHERE tl_namespace = 10 AND tl_from_namespace = 0) AS uses ON uses.tl_title = templates.page_title 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...