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: Subquery with null returns

Re: Subquery with null returns

From: Telemachus <telemachus_at_ulysseswillreturn.net>
Date: Fri, 28 Mar 2003 11:50:59 -0000
Message-ID: <DGWga.5487$pK2.5328@news.indigo.ie>


Tom Kyte did a very comprehensive treatment of this on asktom "David Wang" <ywang_at_adelphia.net> wrote in message news:hrJga.7483$FN.4100466_at_news2.news.adelphia.net...
> Hi, I have a subquery question, thanks for any response.
> "EMP" table has two columns "empno" and "mgr", I do this
> SELECT ENAME FROM EMP WHERE EMPNO NOT IN
> (SELECT MGR FROM EMP);
> I assumed this query will give me all employees who are not
> manager but it returns me "no rows selected" bacause one employee
> has null value in "MGR" column in subquery. Then I do,
> SELECT ENAME FROM EMP WHERE EMPNO IN
> (SELECT MGR FROM EMP);
> it gives me the names of all managers as it should.
> why with the same subquery one can retrives rows and one can't.
> I did this query on 8.1.7
> -DW-
>
>
Received on Fri Mar 28 2003 - 05:50:59 CST

Original text of this message

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