SQL
x
#SELECT * FROM image
#INNER JOIN page ON page_title = img_name AND page_namespace = 6
##INNER JOIN revision ON rev_page = page_id
#INNER JOIN filearchive ON fa_name = img_name
SELECT * from filearchive
INNER JOIN filearchive ON fa_deleted_reason_id = comment_id
INNER JOIN image ON fa_name = img_name
INNER JOIN page ON page_title = img_name AND page_namespace = 6
WHERE
##rev_deleted != 0
##AND
img_name IN
(SELECT page_title
FROM page
INNER JOIN categorylinks ON cl_from = page_id
WHERE cl_to = 'Copy_to_Wikimedia_Commons_with_hidden_file_revisions'
)
AND
img_name NOT IN
(SELECT fa_name FROM filearchive
WHERE fa_deleted = 0)
##AND
##filearchive
;
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.