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

Subquery with null returns

From: David Wang <ywang_at_adelphia.net>
Date: Thu, 27 Mar 2003 20:47:09 GMT
Message-ID: <hrJga.7483$FN.4100466@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 Thu Mar 27 2003 - 14:47:09 CST

Original text of this message

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