sql - using MAX aggregate between two tables -
sql - using MAX aggregate between two tables -
i have 2 tables, employer , position:
employer eid ename
position eid salary
i need match eid between 2 tables, determine max salary is, , print ename. suggestions how can this? have tried multiple ways, nil seems work.
i not sure set in max(salary) function:
select ename employer, position employer.eid = position.eid
to name(s) of people highest salary...
using join:select e.name employer e bring together position x on x.eid = e.eid bring together (select max(salary) max_salary position) y on y.max_salary = x.salary
using subquery: select e.name employer e bring together position p on p.eid = e.eid p.salary = (select max(salary) position)
sql table aggregate max match
Comments
Post a Comment