Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: optimal sql
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