SQL
AخA
SELECT page_id,
CONCAT('[[', page_title, ']]') AS 'page title',
CASE WHEN page_is_redirect = 0 THEN NULL
ELSE (SELECT CASE WHEN rd_namespace = 0 THEN CONCAT('[[', rd_title, ']]')
ELSE CONCAT('[[{{ns:', rd_namespace, '}}:', rd_title, ']]')
END
FROM redirect
WHERE rd_from = page_id)
END AS 'redirect to',
EXISTS (SELECT 1 FROM categorylinks
WHERE cl_from = page_id
AND cl_to = 'All_redirects_for_discussion') AS 'is on WP:RFD'
FROM page
WHERE page_namespace = 0
AND page_title RLIKE '\\(Q[0-9]+\\)';
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.