Skip to content

Instantly share code, notes, and snippets.

@isccarrasco
Created June 23, 2016 16:34
Show Gist options
  • Save isccarrasco/c932056ec3a59aa01448784e1cbb573e to your computer and use it in GitHub Desktop.
Save isccarrasco/c932056ec3a59aa01448784e1cbb573e to your computer and use it in GitHub Desktop.
Find duplicate rows with PostgreSQL
select * from (
SELECT id,
ROW_NUMBER() OVER(PARTITION BY merchant_Id, url ORDER BY id asc) AS Row
FROM Photos
) dups
where
dups.Row > 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment