/ Published in: MySQL
Use the same table to query against itself. The greater then sign does the main job of returning only one records of both duplicate records.
Expand |
Embed | Plain Text
DELETE FROM table1 USING table1, table1 AS vtable WHERE ( table1.ID > vtable.ID ) AND ( table1.field1 = vtable.field1 ) AND ( table1.field2 = vtable.field2 ) AND ( table1.field3 = vtable.field3 ) AND ( table1.field4 = vtable.field4 )
You need to login to post a comment.
