본문 바로가기
algorithm/hackerRank

hackerrank Top Earners 풀이

by 무대포 개발자 2020. 9. 23.
728x90
반응형

Top Earners

oracle

select maxEarning, num
from (
select
months * salary as maxEarning
,count(*) as num
from Employee
group by months * salary
order by months * salary desc
)
where rownum = 1
;

mysql

select
months * salary as maxEarning
,count(*) as num
from Employee
group by months * salary
order by months * salary desc
limit 1
;
```

'algorithm > hackerRank' 카테고리의 다른 글

Hackerrank The Grid Search 풀이  (0) 2020.10.07
hackerrank case when 문제 풀이  (0) 2020.09.27
hackerrank Non-Divisible Subset 풀이  (0) 2020.09.21
hackerrank the-time-in-words 풀이  (0) 2020.09.18
Hackerrank Bigger is greater  (0) 2020.09.14

댓글