Skip to content

Instantly share code, notes, and snippets.

@LexaChebara
Created September 12, 2013 09:04
Show Gist options
  • Select an option

  • Save LexaChebara/6534766 to your computer and use it in GitHub Desktop.

Select an option

Save LexaChebara/6534766 to your computer and use it in GitHub Desktop.
Quick removing of duplicate rows in Oracle table T over X, where X can be set of columns.
DELETE FROM T WHERE ROWID IN (
SELECT rid
FROM (SELECT ROWID rid, ROW_NUMBER() OVER ( PARTITION BY X ORDER BY ROWID ) rn FROM T)
WHERE rn > 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment