查找特定行
条件:最晚入职
条件代码:WHERE hire_date = (SELECT MAX(hire_date) FROM employees)
SELECT * FROM employees WHERE hire_date = ( SELECT MAX(hire_date) FROM employees );
- 不能用ORDER BY...LIMIT 1 的原因:
最晚日期可能存在多个员工
查找特定行
条件:最晚入职
条件代码:WHERE hire_date = (SELECT MAX(hire_date) FROM employees)
SELECT * FROM employees WHERE hire_date = ( SELECT MAX(hire_date) FROM employees );