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
Cryptic
.
For [[w:WP:RAQ#Rcat templates and their redirects]] circa 15 Aug 2019. Does not include redirects to pages in subcategories of the named category, only to the subcategory pages themselves.
Toggle Highlighting
SQL
SELECT CONCAT('[[', CASE t.page_namespace WHEN 10 THEN 'Template:' WHEN 12 THEN ':Category:' ELSE CONCAT('{{ns:', t.page_namespace, '}}:') END, t.page_title, ']]') AS 'redir_to', CONCAT('[[', CASE r.page_namespace WHEN 0 THEN ':' WHEN 2 THEN 'User:' WHEN 4 THEN 'Wikipedia:' WHEN 10 THEN 'Template:' WHEN 12 THEN 'Help:' ELSE CONCAT('{{ns:', r.page_namespace, '}}:') END, r.page_title, ']]') AS 'redir_from' FROM page t LEFT JOIN redirect ON t.page_namespace = rd_namespace AND t.page_title = rd_title LEFT JOIN page r ON r.page_id = rd_from JOIN categorylinks ON t.page_id = cl_from WHERE cl_to = 'Redirect_templates' ORDER BY redir_to, redir_from;
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...