Fork of
bad characters in wikilinks
by Achim55
This query is marked as a draft
This query has been published
by Achim55.
SQL
AخA
#describe pagelinks;
#describe redirect;
SELECT CONCAT('# [[Template:', REPLACE (p.page_title,'_',' '), ']]',
# IF (EXISTS (SELECT 1 FROM linktarget INNER JOIN pagelinks ON pl_target_id = lt_id WHERE lt_title = p.page_title AND lt_namespace = 10 AND pl_from != 154056166), '', '<sup>(unlinked)</sup>'),
' → [[',
IF (rd_namespace IN (6, 14) OR rd_title LIKE 'en:%', ':', ''),
IF (rd_namespace != 0, CONCAT('{{ns:', rd_namespace, '}}:'), ''),
REPLACE (rd_title,'_',' '), ']]' ) AS links
FROM redirect
INNER JOIN page p ON p.page_id = rd_from AND p.page_namespace = 10
WHERE rd_namespace NOT IN (10, 828)
ORDER BY rd_namespace, p.page_title
LIMIT 500;
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.