Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
de.wikibooks GFDL files by upload date in cat
by
MGA73
This query is marked as a draft
This query has been published
by
MGA73
.
Toggle Highlighting
SQL
-- Query to get original upload date from the image table SELECT CONCAT("# [[:File:", page_title, "]]") as File, img_timestamp as original_upload_date FROM templatelinks JOIN page ON tl_from = page_id JOIN image ON img_name = page_title AND page_namespace = 6 JOIN categorylinks ON cl_from = page_id AND cl_type = "file" AND cl_to = "GFDL-Bild" WHERE img_timestamp = ( SELECT MIN(img_timestamp) FROM image WHERE img_name = page_title ) GROUP BY page_title, img_timestamp UNION ALL -- Query to get information from the oldimage table SELECT CONCAT("# [[:File:", oi_name, "]]") as File, oi_timestamp as original_upload_date FROM oldimage INNER JOIN page p ON p.page_title = oi_name AND p.page_namespace = 6 INNER JOIN categorylinks c ON c.cl_from = p.page_id AND c.cl_to = "GFDL-Bild" -- Non-free files -- INNER JOIN categorylinks c ON c.cl_from = p.page_id AND c.cl_to = "सभी_मुक्त_मीडिया" -- Free files WHERE oi_deleted = 0 AND oi_timestamp = ( SELECT MIN(oi_timestamp) FROM oldimage WHERE oi_name = p.page_title ) GROUP BY oi_name, oi_timestamp;
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...