SQL-最高薪水
不用max函数 求最高薪水
方法一:
SELECT salary FROM EMP ORDER BY salary LIMIT 1;
方法二:(可以查询出相同最高薪水的员工)
SELECT salary FROM EMP
WHERE salary NOT IN
(SELECT salary FROM EMP A INNER JOIN EMP B
ON A.salary < B.salary)
不用max函数 求最高薪水
方法一:
SELECT salary FROM EMP ORDER BY salary LIMIT 1;
方法二:(可以查询出相同最高薪水的员工)
SELECT salary FROM EMP
WHERE salary NOT IN
(SELECT salary FROM EMP A INNER JOIN EMP B
ON A.salary < B.salary)
相关推荐