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: Convert complex delete sql statement to Oracle?

Re: Convert complex delete sql statement to Oracle?

From: Gene Hubert <gwhubert_at_hotmail.com>
Date: 21 Aug 2002 08:56:31 -0700
Message-ID: <7e3fa619.0208210756.cfe7ee@posting.google.com>


Depending on how your keys are set up, you might be able to do something like:

DELETE from(select A.*
FROM TABLE1 A, TABLE2 B, TABLE3 C
WHERE A.MYKEY= B.MYKEY AND A.UNIQUEKEY = B.UNIQUEKEY

     AND B.MYKEY= C.MYKEY
     AND C.KEY1 NOT BETWEEN 'A' AND 'Z');

This is essentially a delete through a view and there are restrictions on what you can do this way. For testing you could add "and rownum=1" to quickly see if this will work for you.

Gene Hubert
Durham, NC

"Brad Pybus" <brad_pybus7zwq_at_hotmail.com> wrote in message news:<b1y89.1237$Bd4.10300_at_dfw-service2.ext.raytheon.com>...
> I can do this statement in SQL Server but I can not figure out how to do it
> in Oracle. I just want it to delete records in Table1.
>
>
> DELETE A
> FROM TABLE1 A, TABLE2 B, TABLE3 C
> WHERE A.MYKEY= B.MYKEY AND A.UNIQUEKEY = B.UNIQUEKEY
> AND B.MYKEY= C.MYKEY
> AND C.KEY1 NOT BETWEEN 'A' AND 'Z';
Received on Wed Aug 21 2002 - 10:56:31 CDT

Original text of this message

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