【MySQL】simple window function
\nselect b.Name as Department, a.Name as Employee, Salary\nfrom \n# rank Salary in department\n(select *, dense_rank () over (partition by DepartmentId order by
```\nselect b.Name as Department, a.Name as Employee, Salary\nfrom \n# rank Salary in department\n(select *, dense_rank () over (partition by DepartmentId order by Salary desc) as salaryRank\nfrom Employee) a \njoin Department b \non a.DepartmentId = b.Id and a.salaryRank = 1\n```
['MySQL']