题目链接:点击打开链接
题目大意:略。
解题思路:略。
AC 代码
-- 解决方案(1) select a.employee_id from Employees a where a.salary < 30000 AND a.manager_id is not null AND not exists (select 1 from Employees b where a.manager_id = b.employee_id) ORDER BY a.employee_id; -- 解决方案(2) SELECT employee_id FROM Employees WHERE salary < 30000 AND manager_id NOT IN (SELECT employee_id FROM Employees) ORDER BY 1