Top two salary levels per department
MediumMicrosoftdense_ranktop n per group· 20 XP
Microsoft's compensation team reviews the top earners in each department. If two people share a salary, both should be included.
For each dept_id, list everyone paid at the two highest salary levels in that department (ties included).
Expected output
- Any row order
Example of the shape (made-up values):
| dept_id | emp_id | salary |
|---|---|---|
| 3 | 15 | 262000 |
Hints, the later questions and the answer come with Pro.
Write your query here. Ctrl + Enter submits.