Re: How to delete duplicate rows with sql
Posted in 1995
Wayne Harlech-Jones — — source: Informix-list mailing list archive (1991-1998)
Siva Pothireddy asked:
>Could any body tell me how to delete duplicate rows in a table.
One method I use, which is long winded an inelegant, but does work is as
follows:
In SQL do
unload to "dupl.unl"
select unique * from dup_table;
delete from dup_table where 1=1;
load from "dupl.unl"
insert into dup_table;
Dup_table is the name of the table woth the duplicates.
You can speed up this process by dropping you indexes first nad recreating
them afterward. It is also a good idea to turn off logging or have
continous logging on as this process fills up the logs incredibly quikly.
Yours
Wayne
|\\/\\/ayne
|Wayne Harlech-Jones
|Windhoek, Namibia, Africa
|wayne@jones.mac.alt.na