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: SQL Too difficult for me do you know how?

Re: SQL Too difficult for me do you know how?

From: bjin <jinbo_at_hpsgns1.sgp.hp.com>
Date: Fri, 05 Mar 1999 13:45:48 +0800
Message-ID: <36DF6F8C.895A57A3@hpsgns1.sgp.hp.com>


Just one statement will do the job:

delete <table_name>
where recordid not in (

    select max(recordid) from <table_name>     group by clientid, addressid );

regards
bjin

Jobi wrote:

> Hi,
>
> I have a Table with somewhat duplicate record and I would like to delete
> the duplicates Here is an Exemple of the table:
>
> RecordID ClientID AddressID
>
> 1 688 123
> 2 688 123
> 3 783 142
> 4 783 143
>
> Note: RecordID is created on Insert to provide a Unique Number to Index On.
> It is NOT ROWID
>
> Now What I would like to do is get rid of All but ONE of the Records that
> Have the Same ClientID AND AddressID....
>
> Thanks for your help....
>
> Eric
Received on Thu Mar 04 1999 - 23:45:48 CST

Original text of this message

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