Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Q: Find end delete duplicate values?
In article <36bd7181.1729686_at_news.online.no>,
lysbakke_at_online.no (Rune Lysbakken) wrote:
> I want to create an unique index but I have some duplicate values. I
> think I can find them with a combination of count, group and having
> Count ()> 1 but how can I delete so that only one of the duplicates
> remains? Perhaps I can use rowid? I want a solution that I can use
> with many duplicates without a lot of typing!
>
> regds Rune
>
let say your table name is tb_test and the unique column is abc.
delete tb_test
where rowid in (select a.rowid
from tb_test a, tb_test b where a.abc = b.abc and a.rowid < b.rowid); -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your OwnReceived on Tue Feb 09 1999 - 03:13:33 CST
![]() |
![]() |