题目链接:点击打开链接
题目大意:略。
解题思路:略。
AC 代码
-- 解决方案(1) with t as ( select employee_id from Employees union all select employee_id from Salaries) select employee_id from t group by employee_id having count(employee_id)=1 order by employee_id -- 解决方案(2) WITH t AS (SELECT employee_id FROM Employees UNION SELECT employee_id FROM Salaries) SELECT * FROM t WHERE employee_id NOT IN (SELECT e.employee_id FROM Employees e JOIN Salaries s USING(employee_id)) ORDER BY employee_id