https://platform.stratascratch.com/coding/10308-salaries-differences?code_type=3
SELECT ABS(MAX(db_employee.salary) - (
SELECT MAX(db_employee.salary)
FROM db_employee
GROUP BY department_id
HAVING department_id = 4
))
FROM db_employee
GROUP BY department_id
HAVING department_id = 1
|
cs |
'HackerRank' 카테고리의 다른 글
[StrataScratch] Workers With The Highest Salaries - 최대 값 찾기 [MySQL] (0) | 2022.06.22 |
---|---|
[HackerRank Easy] Weather Observation Station 5[MySQL] (0) | 2022.05.27 |
[HackerRank Medium] Symmetric Pairs [MySQL] (0) | 2022.05.26 |
[MySQL] The Report [HackerRank Medium] (0) | 2022.05.26 |
[MySQL] Binary Tree Nodes [HackerRank Medium] (0) | 2022.05.26 |