You can use the dirty flag with a default value of 1 and copy only individual entries with the flag set to 0 , and then simply delete all the dirty entries. This way you do not need another table.
Assuming you already created a dirty flag with a default value of 1 :
insert into mytable select fld1,fld2,fldN,0 as dirty from mytable group by duplicate_field
Then you can simply delete the dirty entries:
delete from mytable where dirty = 1
Remember to remove the dirty flag. you did it
clamiax
source share