LeetCode-SQL-184。最高の有給部門の従業員

https://leetcode-cn.com/problems/department-highest-salary/

自分の無知を許します。で長時間露光デュアルフィールド。

SELECT
    Department.name AS 'Department',
    Employee.name AS 'Employee',
    Salary
FROM
    Employee
        JOIN
    Department ON Employee.DepartmentId = Department.Id
WHERE
    (Employee.DepartmentId , Salary) IN
    (   SELECT
            DepartmentId, MAX(Salary)
        FROM
            Employee
        GROUP BY DepartmentId
	)
;

 

公開された137元の記事 ウォンの賞賛2 ビュー20000 +

おすすめ

転載: blog.csdn.net/m0_37302219/article/details/104949110