Skip to content

Instantly share code, notes, and snippets.

@ramiroaznar
Created August 12, 2016 12:17
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save ramiroaznar/f23236b7284c823b2fa5692d6fc4c1f6 to your computer and use it in GitHub Desktop.
Save ramiroaznar/f23236b7284c823b2fa5692d6fc4c1f6 to your computer and use it in GitHub Desktop.
How to find duplicate values with PostgreSQL
select * from table t1
where (select count(*) from table t2
where t1.field = t2.field) > 1
order by field
@JefferyHus
Copy link

well done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment