📜  sql 查找薪水第二高的员工 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:19.539000             🧑  作者: Mango

代码示例3
/*  Highest salary by Department/Location   */
SELECT e.ename, e.sal, e.deptno, d.loc
FROM emp e
JOIN dept d
ON e.deptno = d.deptno
WHERE e.sal in
(     
      select max(sal) 
      from emp 
      group by deptno
)