查询
in关键字的使用
不局限于 salary in( , )
还可以是(departmentId, salary) in (select departmentId, salary from ....)


select D.Name Department, E.Name Employee, Salary from Department D inner join Employee E on D.Id = DepartmentId
where (DepartmentId, Salary) in (select DepartmentId, max(Salary) from Employee group by DepartmentId)

浙公网安备 33010602011771号