mirror of
https://github.com/devenperez/leetcode.git
synced 2026-06-13 14:57:08 +00:00
13 lines
275 B
SQL
13 lines
275 B
SQL
# Write your MySQL query statement below
|
|
SELECT
|
|
employee_id,
|
|
salary as bonus
|
|
FROM Employees
|
|
WHERE employee_id % 2 = 1 AND name NOT LIKE 'M%'
|
|
UNION
|
|
SELECT
|
|
employee_id,
|
|
0 as bonus
|
|
FROM Employees
|
|
WHERE employee_id % 2 = 0 OR name LIKE 'M%'
|
|
ORDER BY employee_id |