I am trying to create a SELECT statement that displays ename, deptno, sal from the scott.emp table on people who earn more than the average sal in their department. NOT the total average of all the sal but the average from each departments. Please help
Thanks Carp... You the man
I am pretty new to Oracle and I appreciate you guys helping people like me.
OK so here's another one if you don't mind or for anybody.
I ran against scott.emp
SELECT worker.ename
FROM emp worker
WHERE worker.empno not in
(SELECT manager.mgr
FROM emp manager)
why am I getting "no rows selected"
I understand that if I take off the "not" in the where clause I would get something. This means that they are a manager for somebody. So shouldn't the SQL above show the people that are not managers?
[tt]
SELECT worker.ename
FROM emp worker
WHERE worker.empno not in
(SELECT manager.mgr
FROM emp manager WHERE mgr IS NOT NULL)
^^^^^^^^^^^^^^^^^^^^^
[/tt]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.