查询每个部门工资最高的员工信息。
SELECT
e.emp_name, d.dept_name, e.salary
FROM
emp e inner join dept d ON e.dept_id = d.dept_id
WHERE
(e.dept_id, e.salary) IN (
SELECT
e.dept_id, max(e.salary) AS salary
FROM
emp e inner join dept d ON e.dept_id = d.dept_id
group by dept_id
)
标签:salary,join,进阶,DataBase,查询,dept,emp,SQL,id
From: https://www.cnblogs.com/feiqiangsheng/p/16884046.html