Home
/
Questions
/
Coding
/
Top 2 earners per department (DENSE_RANK)
caseSQL
Coding question · Top N Per Group
Medium
Asked at Amazon
Top 2 earners per department (DENSE_RANK)
DENSE_RANK with PARTITION BY, keeping ties.
Unlock with Pro
→
Back to all coding questions
The Brief
← Previous
Employees earning above their department average
Next →
Each category's share of total revenue