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

NOT IN/Nulls/ NOT EXISTS

From: colmkav <colmjkav_at_yahoo.co.uk>
Date: Fri, 06 Jul 2007 01:07:53 -0700
Message-ID: <1183709273.910935.99470@o61g2000hsh.googlegroups.com>


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
)
Received on Fri Jul 06 2007 - 03:07:53 CDT

Original text of this message

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