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/Nulls/ NOT EXISTS

Re: NOT IN/Nulls/ NOT EXISTS

From: Scott <Scott.Mattes_at_gmail.com>
Date: Fri, 06 Jul 2007 13:06:52 -0000
Message-ID: <1183727212.758467.7520@o61g2000hsh.googlegroups.com>


On Jul 6, 4:07 am, colmkav <colmj..._at_yahoo.co.uk> wrote:
> which would you normally expect to work quicker and why? ie how does
> the using of NOT EXISTS compare with the using of Nulls
>
> 1)
> select count(*) from (
> SELECT distinct sourceid, strategy, strategyname, area, product
> FROM t_bookmap
> WHERE SourceId = 1 AND not exists(select strategy from
> ta_strategy where SourceId = 1 AND TA_STRATEGY.strategy =
> T_BOOKMAP.strategy)
> )
>
> 2)
> select count (*) from (
> SELECT distinct T.sourceid, T.strategy, T.strategyname, T.area,
> T.product
> FROM t_bookmap T, (select strategy from ta_strategy where
> sourceid = 1) TA
> WHERE T.SourceId = 1 AND TA.strategy(+) = T.strategy AND
> TA.strategy is NULL
> )

What did you see when you tried it? Tom Kyte has answered this over on AskTom.oracle.com Received on Fri Jul 06 2007 - 08:06:52 CDT

Original text of this message

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