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: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Fri, 05 Mar 1999 00:28:26 +0100
Message-ID: <36DF1719.40D85C4F@sybrandb.demon.nl>


delete from table x
where x.recordid =
(select max(recordid)
 from table y
 where y.clientid = x.clientid
 and y.addressid = x.addressid)
This should delete the record with recordid 2 only.

Hth,

Sybrand Bakker, Oracle DBA

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 - 17:28:26 CST

Original text of this message

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