Leetcode - 1077. Project Employees III

문제

Loading...
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

정답

SELECT project_id,Employee.employee_id  FROM Project
JOIN Employee ON Project.employee_id = Employee.employee_id
WHERE (project_id, experience_years) IN
(SELECT project_id,MAX(experience_years) as max_years FROM Project
JOIN Employee ON Project.employee_id = Employee.employee_id
GROUP BY project_id)