Created
July 20, 2013 14:29
-
-
Save amitchhajer/6045247 to your computer and use it in GitHub Desktop.
Delete duplicate records from database leaving one of them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delete from my_table mt1, my_table mt2 where mt1.fieldX = mt2.fieldX and mt1.fieldY = mt2.fieldY and mt1.primary_key > mt2.primary_key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment