Re: Replace NOT IN w/ NOT EXISTS ?

From: Scott McCloud <sm02_at_flex>
Date: Thu, 22 Dec 1994 20:38:56 GMT
Message-ID: <sm02.3.2EF9E3DF_at_flex>


In article <3dcl9c$cv7_at_info.eng.octel.com> dan.bikle_at_octel.com (Dan Bikle) writes:

>Hi there,
 

>select ename from emp
>where empno NOT IN
>(select empno from empexclude)
>/
 

>can be replaced by a quicker method.
>something like:

>select ename from emp
>where NOT EXISTS ...
 

>I forget the rest.
 

>Anyone got a demo?
 

>-Dan
>dbikle_at_alumni.caltech.edu

Try...

select ename from emp e
where not exists (select null from empexclude ex

                             where ex.empno = e.empno);

That should do it.

Scott Received on Thu Dec 22 1994 - 21:38:56 CET

Original text of this message