Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: delete duplecated rows
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
![]() |
![]() |