根据题目每个成员都给出了薪水排名,先左自然连接两张表,然后group by分组找出每组最大的薪水,最后order by 默认升序排序 select d.dept_no,s.emp_no,max(s.salary) as maxSalary from dept_emp as d left join salaries as s on d.emp_no=s.emp_no group by d.dept_no order by d.dept_no