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
Certes
.
Toggle Highlighting
SQL
WITH tt AS (SELECT page_title AS Template, COUNT(*) AS Transclusions FROM page_restrictions JOIN page ON page_id = pr_page AND page_namespace = 10 AND page_is_redirect = 0 JOIN linktarget ON lt_namespace = 10 AND lt_title = page_title JOIN templatelinks ON tl_target_id = linktarget.lt_id WHERE pr_type = 'edit' AND pr_level = 'sysop' /* AND pr_expiry = 'infinity' */ GROUP BY Template) SELECT "1 Least" AS Type, Template, Transclusions FROM tt WHERE Transclusions = (SELECT MIN(Transclusions) FROM tt) UNION SELECT "2 Most", Template, Transclusions FROM tt WHERE Transclusions = (SELECT MAX(Transclusions) FROM tt) UNION SELECT "3 Median", "", MEDIAN(Transclusions) OVER () FROM tt UNION SELECT "4 Average", "", SUM(Transclusions)/COUNT(*) FROM tt UNION SELECT "5 All", Template, Transclusions FROM tt ORDER BY Type, Template
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...