Fork of
Links to redirecting file pages - local
by Achim55
This query is marked as a draft
This query has been published
by Achim55.
SQL
AخA
USE dewiki_p;
#USE enwiki_p;
#USE eswiki_p;
#USE frwiki_p;
#USE nlwiki_p;
#USE svwiki_p;
SET @w = LEFT (DATABASE(), LENGTH(DATABASE()) - 2);
SELECT now() AS timestamp;
#globalimagelinks
SELECT CONCAT('# [[c:File:', REPLACE (gil_to, '_', ' '), ']]')
FROM commonswiki_p.globalimagelinks
INNER JOIN page wp ON wp.page_id = gil_page AND wp.page_namespace IN (0, 14)
INNER JOIN commonswiki_p.page cp ON cp.page_title = gil_to AND cp.page_namespace = 6 AND cp.page_is_redirect = 1
WHERE gil_wiki = @w
GROUP BY gil_to
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.