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 Puzzle ...

Re: SQL Puzzle ...

From: Steffen Stellwag <Steffen.Stellwag_at_pcm.bosch.de>
Date: Mon, 16 Nov 1998 11:17:17 +0100
Message-ID: <364FFBAD.7E0E@pcm.bosch.de>


K. Raghuraman wrote:
>
> Hi,
>
> I have a table with three columns and no keys defined. I want to
> eliminate only the duplicate records from the table in a single SQL
> delete statement. How do I construct my SQL statement ?
>
> Thanks and Regards,
>
> Raghu

Hi

placehoder key for better reading my example :

   key := col1 ||col2||col3 ;

the delete-statement is as follows :

DELETE FROM TABLE T where T.ROWID > (SELECT MIN(T.ROWID) FROM TABLE X

                        WHERE X.KEY = L.KEY );

Thats it

Steffen Received on Mon Nov 16 1998 - 04:17:17 CST

Original text of this message

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