select e.empno,e.ename,e.sal from emp e
where e.sal > (select m.sal from emp m where m.empno =(select mgr from emp mg where e.empno = mg.empno) and m.empno = e.mgr)
where e.sal > (select m.sal from emp m where m.empno =(select mgr from emp mg where e.empno = mg.empno) and m.empno = e.mgr)
*
FROM
EMP EM
WHERE
SAL > (SELECT SAL FROM EMP WHERE EMPNO = EM.MGR)
--------------
SELECT E.SAL,E.EMPNO,E.ENAME,M.SAL MSAL
FROM EMP E,EMP M
WHERE M.EMPNO = E.MGR
AND E.SAL > M.SAL
No comments:
Post a Comment