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: Niall Litchfield <niall.litchfield_at_dial.pipex.com>
Date: Sun, 15 Dec 2002 21:57:01 -0000
Message-ID: <3dfcfaae$0$234$cc9e4d1f@news.dial.pipex.com>


"Christoph Seidel" <chris666.seidel_at_gmx.de> wrote in message news:at31k8$vtma0$1_at_ID-143718.news.dfncis.de...
> Alex Filonov wrote:
>
> > If I understand it right, pk column is a primary key in the second
> > table as well.
>
> yes
>
> > In this case, there is no difference between not in and
> > not exists.
>
> why?

Because , since it is a primary key, there can only ever be one match. As Alex says Oracle will search the unique index to fnd it.

--
Niall Litchfield
Oracle DBA
Audit Commission UK
*****************************************
Please include version and platform
and SQL where applicable
It makes life easier and increases the
likelihood of a good answer
******************************************
Received on Sun Dec 15 2002 - 15:57:01 CST

Original text of this message

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