Skip to content

Commit 343b043

Browse files
committed
🟢 Solve problem 1789
1 parent 4c29cc6 commit 343b043

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎sql/1789.sql

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
SELECT employee_id, department_id
2+
FROM Employee
3+
WHERE primary_flag = 'Y'
4+
OR employee_id IN (
5+
SELECT employee_id
6+
FROM Employee
7+
GROUP BY employee_id
8+
HAVING COUNT(*) = 1
9+
);

0 commit comments

Comments
 (0)