HackerRank
[StrataScratch] Workers With The Highest Salaries - 최대 값 찾기 [MySQL]
치킨먹고싶어요
2022. 6. 22. 14:31
https://platform.stratascratch.com/coding/10353-workers-with-the-highest-salaries?code_type=3
StrataScratch
platform.stratascratch.com
코드
SELECT worker_title
FROM worker
JOIN title
ON worker_id = worker_ref_id
WHERE salary = (
SELECT max(salary)
FROM worker
);
|
cs |
풀이
1. 서브 쿼리를 만들어 줍니다.
2. 서브 쿼리의 값과 같을 때를 WHERE로 구분합니다.