Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to delete duplicate rows
Try this:
delete from <table a>
where a.rowid IN (select max(rowid)
from <tableb b> group by <duplicate field> having count > 1);
Hope this help....
-- -------------------------------------------------------------- Ivan Boesing Oracle DBA boesing_at_geocities.com ------------------------------------------------------------- David Hamilton <david.hamilton_at_sap-ag.de> escreveu no artigo <ELA3pv.Esq_at_sap-ag.de>...Received on Tue Dec 16 1997 - 00:00:00 CST
> Does anyone have an SQL script for deleting duplicate rows in a table. I
> have a table of approximately 320Mb, and I can't create a primary key on
the
> table due, I assume, to duplicates.
> It is on a DEC UNIX 4.0 with Oracle 7.3.3.3.0, but I don't think that
makes
> a difference.
> If replies could please be sent to david.hamilton_at_sap-ag.de.
> Any help much appreciated,
> David Hamilton.
> SAP SSC Ireland Ltd.
>
>
>