Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: NOT IN/Nulls/ NOT EXISTS
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