easycompany HR · Q1
window functionsties

Highest paid per department

For each department, return the current employee (or employees, if there's a tie) with the highest salary.

Departments with no current employees don't appear.

output columns
dept_namenamesalary

uses ,

ctrl + enter to run on the sample data · ctrl + shift + enter to submit

run your query to see the output here. Submit checks it against the sample data, hidden test cases, random data and a large dataset.