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
Cryptic
.
For [[WP:VPT#Is there a way to find (free) files with more than one (not deleted) version in the history?]] circa 22 Apr 2020.
Toggle Highlighting
SQL
SELECT CONCAT('File:', REPLACE(oi_name, '_', ' ')) AS filename, COUNT(*) AS 'old versions' FROM oldimage JOIN page ON page_namespace = 6 AND page_title = oi_name WHERE (oi_deleted & 1) = 0 AND NOT EXISTS (SELECT 1 FROM categorylinks WHERE page_id = cl_from AND cl_to = 'All_non-free_media') GROUP BY oi_name;
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...