I am trying to write a query to display manager no. and the lowestwages employee for manager. we discard wages less than 1k
So I tried writing a code for it but its giving me an error. I think I have to edit the FROM condition in the second line:
SELECT empno, sal
FROM emp a, emp b
WHERE empno IN (SELECT boss.empno
FROM emp a, emp boss
WHERE a.super = boss.empno)
AND MIN(sal) >1000;
Try this:
Basically doing a SELF JOIN on employee table and GROUPing BY manager and getting the MIN salary of employee.
Haven’t tested it yet so it may need a bit of tweeking