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: Q: Find end delete duplicate values?

Re: Q: Find end delete duplicate values?

From: <yewpc_at_my-dejanews.com>
Date: Tue, 09 Feb 1999 09:13:33 GMT
Message-ID: <79ou7o$noe$1@nnrp1.dejanews.com>


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 Own    
Received on Tue Feb 09 1999 - 03:13:33 CST

Original text of this message

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