섭섭의 공부/SQL
[HackerRank] Top Earners
seobbseob
2021. 12. 22. 23:04
select months * salary as earnings,
count(*)
from employee
where months * salary =
(select max(months * salary) as max_earnings
from employee)
group by earnings
where 절의 서브쿼리의 output이 하나일 때는 =을 사용해도 된다.
output이 여러 개의 경우 in을 사용