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: NOT IN

Re: NOT IN

From: colmkav <colmjkav_at_yahoo.co.uk>
Date: Wed, 04 Jul 2007 06:49:18 -0700
Message-ID: <1183556958.722737.250000@q69g2000hsb.googlegroups.com>


On 4 Jul, 15:19, sybrandb <sybra..._at_gmail.com> wrote:
> On Jul 4, 2:47 pm, colmkav <colmj..._at_yahoo.co.uk> wrote:
>
> > is it possible to write an SQL Oracle query where you want to check
> > whether a combination of fields exist in another query
>
> > eg I tried the following but got an error:
>
> > select count(*) from tmp_risk_sum where book, strategy, exposuretypeid
> > not in (select book, strategy, exposuretypeid from tmp_risk_sum_ORACLE)
>
> the correct syntax is
> select count(*)
> from tmp_risk_sum
> where (book, strategy, exposuretypeid)
> not in (select book, strategy, exposuretypeid from
> tmp_risk_sum_ORACLE)
>
> Note the extra ()
>
> Syntax errors are preferably resolved by using the documentation.
>
> --
> Sybrand Bakker
> Senior Oracle DBA

cheers, yes the brackets work. Received on Wed Jul 04 2007 - 08:49:18 CDT

Original text of this message

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