Lv2 프로그래머스(Programmers)[Mysql] 조건에 맞는 사원 정보 조회하기

"""
출처:프로그래머스,
https://school.programmers.co.kr/learn/courses/30/lessons/284527
"""

select C.SCORE "SCORE", C.EMP_NO, B.EMP_NAME, B.POSITION, B.EMAIL
from HR_DEPARTMENT as A,HR_EMPLOYEES as B,
( select EMP_NO,YEAR ,sum(score) "SCORE"
from HR_GRADE
group by EMP_NO,YEAR ) as C
where B.EMP_NO = C.EMP_NO
order by SCORE desc
limit 1