-
[HackerRank] Top EarnersmySQL 2023. 2. 27. 00:56
Top Earners | HackerRank
Find the maximum amount of money earned by any employee, as well as the number of top earners (people who have earned this amount).
www.hackerrank.com
SELECT salary*months, count(*) from employee group by salary*months order by salary*months desc limit 1
지금껏 받은 월급의 총합(=소득) 중 제일 많이 받은 사람의 금액, 그리고 그 금액만큼을 받은 사람의 수를 표시하는 문제다.
group by salary*months를 빼먹어서 조금 애먹었던 문제였다.
'mySQL' 카테고리의 다른 글
[HackerRank]-The Report (0) 2023.03.01 [HackerRank] Average Population of Each Continent (0) 2023.02.28 [HackerRank] The Blunder (0) 2023.02.27 [HackerRank] Weather Observation Station 20 (0) 2023.02.26 [HackerRank] Weather Observation Station 19 (0) 2023.02.26