Skip to content

Instantly share code, notes, and snippets.

@edubskiy
Created March 5, 2021 07:51
Show Gist options
  • Save edubskiy/587c5d6de844b3be8135a8780f0f5ad8 to your computer and use it in GitHub Desktop.
Save edubskiy/587c5d6de844b3be8135a8780f0f5ad8 to your computer and use it in GitHub Desktop.
How to find duplicate records in PostgreSQL
select * from yourTable ou
where (select count(*) from yourTable inr
where inr.sid = ou.sid) > 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment