题目链接:点击打开链接
题目大意:略。
解题思路:略。
AC 代码
--解决方案(1) selectp.project_id, p.employee_idfromProjectpjoinEmployeeeonp.employee_id=e.employee_idwhere (p.project_id, e.experience_years) in ( selectp.project_id,max(e.experience_years) fromprojectpjoinemployeeeonp.employee_id=e.employee_idgroupbyp.project_id) --解决方案(2) SELECTproject_id, employee_idFROM (SELECTproject_id, e.employee_id, RANK() OVER(PARTITIONBYproject_idORDERBYexperience_yearsDESC) rnkFROMEmployeeeJOINProjectpONe.employee_id=p.employee_id) RSWHERErnk=1