Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: NOT IN
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
![]() |
![]() |