This query is marked as a draft This query has been published by Zygimantus.

SQL

AخA
 
USE ltwiki_p;
SELECT
  CONCAT('* [[{{ns:', pg2.page_namespace, '}}:', pg2.page_title, ']]') AS redirect,
  CONCAT('-> [[{{ns:', pl_namespace, '}}:', pl_title, ']]') AS redlink
FROM pagelinks
LEFT JOIN page AS pg1
ON pl_namespace = pg1.page_namespace
AND pl_title = pg1.page_title
LEFT JOIN page AS pg2
ON pl_from = pg2.page_id
WHERE pg1.page_namespace IS NULL
AND pg2.page_is_redirect = 1
GROUP BY pg2.page_namespace, pg2.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.
All SQL code is licensed under CC0 License.

Checking query status...