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

Re: Convert complex sql delete statement to Oracle?

From: Richard Kuhler <noone_at_nowhere.com>
Date: Tue, 20 Aug 2002 22:30:41 GMT
Message-ID: <lqz89.154038$Jz.25512653@twister.socal.rr.com>


Assuming that TABLE1 is 'key-preserved' then you could do ...

DELETE FROM (
  SELECT *
  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'

)

See the Oracle documentation for a precise definition of 'key-preserved' if you have troubles.

Richard

Brad Pybus wrote:
>
> 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 Tue Aug 20 2002 - 17:30:41 CDT

Original text of this message

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