0

I've some duplicate rows in my MySQL database-

--------------------------------------------------
| id |  eiin   |  level  |   post_id  |  sub_id  |
--------------------------------------------------    
| 15 | 100003  |    2   |      5     |    301    |   //want to keep this
--------------------------------------------------    
| 65 | 100003  |    2   |      5     |    301    |   //want to delete this
--------------------------------------------------
| 40 | 100003  |    3   |      17    |    105    |   //want to keep this
--------------------------------------------------    
| 73 | 100003  |    3   |      17    |    105    |   //want to delete this
--------------------------------------------------

I would like to delete every 2nd duplicate rows as stated in the above figure.

I can't figure out the SQL. Any help?

This SO has my answer- Delete all Duplicate Rows except for One in MySQL?

s.k.paul
  • 7,099
  • 28
  • 93
  • 168

0 Answers0