If you have a table as follows:
Field1 | Field2 | Field3 |
---|---|---|
John | 2011-10-01 | G |
John | 2011-10-01 | G |
John | 2011-10-01 | G |
George | 2011-01-02 | B |
Klaus | 2001-01-01 | B |
and you would like to remove all duplicate rows, the easiest method is to create an unique index like so:
alter ignore table TABLENAME add unique index INDEXNAME (Field1, Field2, Field3);
then
alter table PCODES drop index xxx;
all the duplicate rows will be removed as follows:
Field1 | Field2 | Field3 |
---|---|---|
John | 2011-10-01 | G |
George | 2011-01-02 | B |
Klaus | 2001-01-01 | B |