文章目录
-
- 原题题目
- 代码实现(首刷自解)
原题题目
代码实现(首刷自解)
# Write your MySQL query statement below
SELECT employee_id,department_id
FROM employee AS e
GROUP BY employee_id
HAVING COUNT(*) = 1UNION
SELECT employee_id,department_id
FROM employee AS e
WHERE primary_flag = 'Y'