MySQL Solution. Window
Code\nmysql []\n# Write your MySQL query statement below\nselect Department, Employee, Salary from (\n    select \n        dense_rank() over w as top,\n        
# Code\n```mysql []\n# Write your MySQL query statement below\nselect Department, Employee, Salary from (\n    select \n        dense_rank() over w as top,\n        d.name as Department, \n        e.name as Employee,\n        salary as Salary\n    from Employee e\n    join Department d on e.departmentId = d.id\n    window w as(\n        partition by e.departmentId\n        order by Salary desc\n    )\n) x\nwhere top = 1;\n```\n\n![\u0421\u043D\u0438\u043C\u043E\u043A \u044D\u043A\u0440\u0430\u043D\u0430 2024-08-11 \u0432 15.09.52.png](https://assets.leetcode.com/users/images/e95f5b74-235c-4804-bd69-c083e6aec820_1724589908.1147046.png)\n
['MySQL']