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: Mike Lanteigne <mikel_at_shec.com>
Date: Wed, 07 Feb 2001 14:47:44 -0800
Message-ID: <F001.002AE674.20010207145005@fatcity.com>

Thanks Elliott, Jack and Krishna.

Well I don't know... after I received your responses I tried in again and it worked!!! Some missing comma or something.

Elliot, this was only an example query, the really query is a little trickier. I am using the minus because using the "not in" (my first choice by the way), is about 100 times slower than using the minus. I'm sure if I played with the indexes a little, that could improve on that, however minus is VERY fast.

Thanks again

Mike

> The syntax is only OK without the "table"'s in it. I think you might be
> seeing some extra underscores where they aren't. If I run the sql exactly
> as it is in this message, I get the same error message stated here. Here
is
> the output:
>
> 1 select * from table A where A.f1 in (
> 2 select f1 from table A
> 3 minus
> 4* select f1 from table B)
> SQL> /
> select * from table A where A.f1 in (
> *
> ERROR at line 1:
> ORA-00906: missing left parenthesis
>
> > -----Original Message-----
> > From: Jack C. Applewhite [SMTP:japplewhite_at_inetprofit.com]
> > Sent: Wednesday, February 07, 2001 3:42 PM
> > To: Multiple recipients of list ORACLE-L
> > Subject: RE: NESTED MINUS?
> >
> > Mike,
> >
> > It's not only possible, but I do it all the time. In fact I
> > just did a query against our database that had a Union
> > nested within a Minus nested within an Intersect - not often
> > I get to use all three in the same statement! This
> > particular Select hit several tables of over a million rows
> > each, with very nice performance - even on Win2k!
> >
> > Your problem might be as simple as SQL*Plus getting stupid
> > (it happens). Try moving the initial parenthesis down to in
> > front of the select on the next line. It may not solve your
> > problem, but might. Your syntax is perfectly OK.
> >
> > Jack
> >
> > --------------------------------
> > Jack C. Applewhite
> > Database Administrator/Developer
> > OCP Oracle8 DBA
> > iNetProfit, Inc.
> > Austin, Texas
> > www.iNetProfit.com
> > japplewhite_at_inetprofit.com
> >
> >
> > -----Original Message-----
> > Mike
> > Lanteigne
> > Sent: Wednesday, February 07, 2001 2:13 PM
> > To: Multiple recipients of list ORACLE-L
> >
> >
> > 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: Jack C. Applewhite
> > INET: japplewhite_at_inetprofit.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).

-- 
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).
Received on Wed Feb 07 2001 - 16:47:44 CST

Original text of this message

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