0

Somehow in my database many repeating rows have been created. I found the bug and fixed it.. But the problem is all the previously created rows are still there and i want to remove the 2nd repeating rows. Manual deleting is not possible as there are 40000+ row

Ex:

1 255 value1
2 255 value1
3 256 value2
4 257 value3

I need the result as

1 255 value1
3 256 value2
4 257 value3

Thanks in advance

Karthik CP
  • 1,150
  • 13
  • 24
  • 1
    Duplicates http://stackoverflow.com/questions/3311903/remove-duplicate-rows-in-mysql and http://stackoverflow.com/questions/2867530/how-to-remove-duplicate-entries-from-a-mysql-db and http://stackoverflow.com/questions/4685173/delete-all-duplicate-rows-except-for-one-in-mysql – Maksim Kudimov Feb 08 '17 at 11:42

1 Answers1

1

You can use

ALTER IGNORE TABLE foobar ADD UNIQUE (title, SID)
Jithin U. Ahmed
  • 1,495
  • 1
  • 19
  • 29