Query to show files that have duplicate hashes.
This commit is contained in:
parent
1b8afaa73f
commit
0701a210db
17
pq/dup.sql
Normal file
17
pq/dup.sql
Normal file
@ -0,0 +1,17 @@
|
||||
SELECT
|
||||
count(f.path) AS Cnt,
|
||||
f.hash AS Hash,
|
||||
array_agg(distinct i.path) Paths
|
||||
FROM
|
||||
files AS f
|
||||
INNER JOIN
|
||||
files i
|
||||
ON
|
||||
i.hash = f.hash
|
||||
GROUP BY
|
||||
f.hash
|
||||
HAVING
|
||||
count(f.path)>1
|
||||
ORDER BY
|
||||
Cnt DESC
|
||||
;
|
||||
Loading…
x
Reference in New Issue
Block a user