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: sybrandb <sybrandb_at_gmail.com>
Date: Wed, 04 Jul 2007 06:19:20 -0700
Message-ID: <1183555160.787214.155430@c77g2000hse.googlegroups.com>


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
Received on Wed Jul 04 2007 - 08:19:20 CDT

Original text of this message

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