#案例:查询员工编号最小且工资最高的员工信息
SELECT *
FROM employees
WHERE (employee_id,salary)=(
SELECT MIN(employee_id),MAX(salary)
FROM employees
);
由以下代码演变而来
SELECT *
FROM employees
WHERE employee_id=(
SELECT MIN(employee_id)
FROM employees
) AND salary=(
SELECT MAX(salary)
FROM employees
);
原文地址:https://blog.51cto.com/14437184/2438296
时间: 2024-11-08 22:42:58