Return to Snippet

Revision: 60006
at October 15, 2012 13:34 by bluecap


Initial Code
DELETE FROM table_name USING table_name, table_name AS vtable 
WHERE (NOT table_name.id = vtable.id) 
AND (table_name.column1 = vtable.column1) 
AND (table_name.column2 = vtable.column2)

Initial URL

                                

Initial Description
Compare a table against itself to remove records where column value(s) are identical.

Initial Title
Delete duplicate records in MySQL database

Initial Tags

                                

Initial Language
MySQL