Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: NESTED MINUS?

RE: NESTED MINUS?

From: Elliott, Patrick <Patrick.Elliott_at_bestbuy.com>
Date: Wed, 07 Feb 2001 13:42:07 -0800
Message-ID: <F001.002AE4A7.20010207133449@fatcity.com>

Try taking out the "table"'s . This is illegal syntax.

    select * from A where A.f1 in (

        select f1 from A
            minus
        select f1 from B);

The sql above is also very inefficient. You don't need to do the minus. Here is the correct syntax:

    select * from A where A.f1 not in (

        select f1 from B);

> -----Original Message-----
> From: Mike Lanteigne [SMTP:mikel_at_shec.com]
> Sent: Wednesday, February 07, 2001 2:13 PM
> To: Multiple recipients of list ORACLE-L
> Subject: NESTED MINUS?
>
> Hi all,
>
> can you use the minus operator in nested sql
> eg
> select * from table A where A.f1 in (
> select f1 from table A
> minus
> select f1 from table B);
>
> I'm getting a "missing right parenthesis" error, so I think it may not be
> possible!
>
> Thanks
>
> Mike
>
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Mike Lanteigne
> INET: mikel_at_shec.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Elliott, Patrick
  INET: Patrick.Elliott_at_bestbuy.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Feb 07 2001 - 15:42:07 CST

Original text of this message

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