1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2024-12-01 01:45:42 +00:00
dindexer/find_duplicate_files.sql

8 lines
462 B
MySQL
Raw Normal View History

--select hash, group_id, count(hash) as hash_count from files group by hash, group_id having count(*) > 1 order by hash;
--select hash, group_id from files group by hash, group_id having count(*) > 1 and count(order by hash;
select files.hash, group_id, t.ct from files inner join (
select hash, count(*) as ct from files group by hash having count(distinct group_id) > 1
) t on t.hash = files.hash group by files.hash, group_id, t.ct order by files.hash;