| deal |
Posted: Mar 12, 2007 10:23:36 AM |
Total Post: 21
Joined: Nov, 2006
|
I'm trying to find the emp who doesnt have anyone working under them
in emp table...query is:
select empno from emp
where empno not in (select distinct(mgr) from emp)
result is :no rows selected
can someone tell why its saying no rows selected...
|
|
|
gps |
| Posted: Mar 12, 2007 10:06:05 PM | |
|
Total Post: 38
Joined: May, 2006
|
Your inner query is returning a null value that's why you didn't get the required result. Try this
select empno from emp
where empno not in (select distinct(mgr) from emp where mgr is not null)
Gurwinder
|
|
|
|
|
deal |
| Posted: Mar 14, 2007 11:41:04 AM | |
|
Total Post: 21
Joined: Nov, 2006
|
Thanks a lot...Its working
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |