Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
This query is marked as a draft
This query has been published
by
MGA73
.
Toggle Highlighting
SQL
USE viwiki_p; SELECT CONCAT("# [[:File:", a.img_name, "]]") AS File, CONCAT("[[:File:", b.img_name, "]]") AS Commons FROM image a INNER JOIN page p ON p.page_title = a.img_name AND p.page_namespace = 6 INNER JOIN categorylinks c ON c.cl_from = p.page_id #join commonswiki_p.image b on b.img_name != a.img_name and b.img_sha1 = a.img_sha1 join commonswiki_p.image b on b.img_sha1 = a.img_sha1 ORDER BY a.img_name ASC
By running queries you agree to the
Cloud Services Terms of Use
and you irrevocably agree to release your SQL under
CC0 License
.
Submit Query
Stop Query
All SQL code is licensed under
CC0 License
.
Checking query status...