Skip to content

Instantly share code, notes, and snippets.

@tralston
Created December 19, 2018 20:09
Show Gist options
  • Save tralston/3db26f29af605a19c5dbcd7bf5fc4f4c to your computer and use it in GitHub Desktop.
Save tralston/3db26f29af605a19c5dbcd7bf5fc4f4c to your computer and use it in GitHub Desktop.
Finding Which dupes have at least one on each source, then showing the paths for all the dupes that qualify
SELECT * from files
WHERE hash IN (
SELECT hash --, COUNT(source)
FROM
(SELECT *, COUNT(source) FROM files
GROUP BY hash, source) AS A
GROUP BY hash
HAVING COUNT(source) > 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment