Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to delete duplicate rows

Re: How to delete duplicate rows

From: Ivan Boesing <boesing_at_geocities.com>
Date: 1997/12/16
Message-ID: <01bd0a61$8e6178e0$46013396@ivan.tre-rs.gov.br>#1/1

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>...

> 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.
>
>
>
Received on Tue Dec 16 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US