Skip to content

Commit 478f8f8

Browse files
committed
test
1 parent b00bb41 commit 478f8f8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- Write your MySQL query statement below
2+
SELECT Department, Employee, Salary
3+
FROM (
4+
SELECT
5+
d.name AS Department,
6+
e.name AS Employee,
7+
e.salary AS Salary,
8+
DENSE_RANK() OVER (PARTITION BY d.name ORDER BY Salary DESC) AS rnk
9+
FROM Employee e
10+
JOIN Department d
11+
ON e.departmentId = d.id
12+
) AS rnk_tbl
13+
WHERE rnk <= 3;

0 commit comments

Comments
 (0)