해커랭크 (1) 썸네일형 리스트형 [해커랭크] Top Earners - Group by 문제출처 : https://www.hackerrank.com/challenges/earnings-of-employees/problem 해설 : 끊어서 생각하기 salary * month = earnings각 earning 별로 몇명이 그 만큼 벌어쓴ㄴ지 계산 ( 5000, 2 / 3000, 5 / 10000, 1) group byearning 중에 가장 큰 값을 가져온다 order by, limit 그러면 이렇게 됨 : 1번 = select salary * months as earnings,2번 = count(*)from employeegroup by earnings3번 = order by earnings desclimit 1 이전 1 다음