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

Home -> Community -> Usenet -> c.d.o.server -> Re: delete duplecated rows

Re: delete duplecated rows

From: Andrew Velichko <andrew.velichko_at_globeinteractive.com>
Date: Wed, 14 Mar 2001 14:51:48 -0500
Message-ID: <pZPr6.154882$Z2.1948784@nnrp1.uunet.ca>

Hi!

Try the following one:
delete from table_name
where rowid in

    (select b.rowid
    from table_name a, table_name b
    where b.col_name=a.col_name
    and b.rowid>a.rowid);
This is not a correllated query and may be will work faster.

Andrew Velichko
Brainbench MVP for Oracle Developer 2000 http://www.brainbench.com


<u132781982_at_spawnkill.ip-mobilphone.net> wrote in message news:l.984596073.1846038818@[198.138.198.252]...
> Hi, I have quite some duplecated rows to delete.
> I tried somebody's suggestion
>
> delete from TABLE_NAME a
> where a.rowid != (select max(row_id)
> from TABLE_NAME b
> where b.col_name = a.col_name)
>
> but it takes so long, finally I have to kill it.
>
> Any better suggestions?
>
> Thanks
>
>
>
>
>
>
>
>
> --
> Sent by dbadba62 from hotmail part of com
> This is a spam protected message. Please answer with reference header.
> Posted via http://www.usenet-replayer.com/cgi/content/new
Received on Wed Mar 14 2001 - 13:51:48 CST

Original text of this message

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