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

SQL

x
 
USE commonswiki_p;
(SELECT CONCAT('# [[:File:', REPLACE (page_title,'_',' '), ']]') AS p
FROM pagelinks pl1
INNER JOIN page
 ON page_title = pl1.pl_title
 AND page_is_redirect = 1
 AND page_namespace = 6
JOIN pagelinks pl2
 ON pl2.pl_title = page_title
 AND pl2.pl_namespace = 6
 AND pl2.pl_from NOT IN (51755049, 61119540, 63412574, 64032037)
 AND pl2.pl_from NOT IN (SELECT ogre.page_id FROM page ogre WHERE ogre.page_namespace = 2 AND ogre.page_title LIKE 'OgreBot%')
 AND pl2.pl_from_namespace % 2 = 0
WHERE pl1.pl_from = 64032037
AND pl1.pl_namespace = 6
)
UNION
(SELECT CONCAT('# [[:File:', REPLACE (page_title,'_',' '), ']]') AS p
FROM pagelinks pl1
INNER JOIN page ON page_title = pl1.pl_title AND page_is_redirect = 1 AND page_namespace = 6
INNER JOIN globalimagelinks ON gil_to = page_title
WHERE pl1.pl_from = 64032037
AND pl1.pl_namespace = 6
)
ORDER BY p
LIMIT 1000;
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...