I have two tables, employer and position:
Employer
eID
eName
Position
eID
salary
I need to match my eID between the two tables, determine what the max salary is, and print only the eName. Any suggestions as to how I can do this? I have tried multiple ways, but nothing seems to work.
I am not sure where to put in the max(salary) function:
select eName
from employer, position
where employer.eID = position.eID
To get the name(s) of the people with the highest salary...
SELECT e.name
FROM EMPLOYER e
JOIN POSITION x ON x.eid = e.eid
JOIN (SELECT MAX(salary) AS max_salary
FROM POSITION) y ON y.max_salary = x.salary
SELECT e.name
FROM EMPLOYER e
JOIN POSITION p ON p.eid = e.eid
WHERE p.salary = (SELECT MAX(salary)
FROM POSITION)
select e.ename,p.salary
from employer e ,position p
where p.salary=(select max(salary) from position)
and e.eid=p.eid
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With