Skip to content

Instantly share code, notes, and snippets.

@michael-simons
Created April 21, 2022 18:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save michael-simons/5e161d948c5c9125b12fc9e506cb55a6 to your computer and use it in GitHub Desktop.
Save michael-simons/5e161d948c5c9125b12fc9e506cb55a6 to your computer and use it in GitHub Desktop.
WITH duplicate_checksums AS (
SELECT MD5 FROM file_duplicates_develop.files
GROUP BY MD5 HAVING COUNT(*) > 1
)
SELECT * FROM file_duplicates_develop.files
WHERE MD5 = duplicate_checksums.MD5
ORDER BY -Size, MD5;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment