Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: optimal sql

Re: optimal sql

From: Christoph Seidel <chris666.seidel_at_gmx.de>
Date: Mon, 9 Dec 2002 22:21:22 +0100
Message-ID: <at31hc$1024vd$1@ID-143718.news.dfncis.de>


damorgan wrote:
> Christoph Seidel wrote:
>
>> how can i find all records by pk in table 1 which are not in table 2
>>
>> is this efficient:?
>>
>> select * from t1 where pk not in (select pk from t2)
>
> No version ... why?

because i wanna learn how it works - independent of the version :)

> I have found that in 8.1.7 NOT EXISTS seems to be the best solution.
> But in 9.2 MINUS is often faster.

thx

>There are at least 7 different SQL statements, all with different explain
plans
> that will accompish the goal. Try them all.

7? damned. which?? Received on Mon Dec 09 2002 - 15:21:22 CST

Original text of this message

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