I need to delete all the duplicated records from one of my tables the problem is that there isn\'t any id or unique or key column so I can\'t make something like this:
Adding a unique index (with all the columns of the table) with ALTER IGNORE will get rid of the duplicates:
ALTER IGNORE TABLE table_name
ADD UNIQUE INDEX all_columns_uq
(phone, address, name, cellphone) ;
Tested in SQL-Fiddle.
Note: In version 5.5 (due to a bug in the implementation of fast index creation), the above will work only if you provide this setting before the ALTER
:
SET SESSION old_alter_table=1 ;