Re: How to delete duplicate rows with sql
Posted in 1995
John Prideaux — — source: Informix-list mailing list archive (1991-1998)
In <D84EDq.6ss@nntpa.cb.att.com> siva@hogpe.ho.att.com (-S.POTHIREDDY)
writes:
>Could any body tell me how to delete duplicate rows in a table. I was
>able to list the duplicate rows in table like this:
>
>select rowid, a.*
> from a, b {a & b are aliases for sam table. basically a self
join}
> where a.rowid != b.rowid;>
Use another table hold your unique rows. Two choices:
1) Use a temp table to hold the unique rows, delete from the
permanent
table, and insert from the temp table
or 2) Use a permanent table, insert the unique rows, drop the
original,
and rename the other.
Hope this helps.
John Prideaux
alastl@ix.netcom.com