Skip to content

Instantly share code, notes, and snippets.

@haseeb-heaven
Created June 6, 2025 13:22
Show Gist options
  • Save haseeb-heaven/f54ea6d2b6bcf75be734a1302c3889e7 to your computer and use it in GitHub Desktop.
Save haseeb-heaven/f54ea6d2b6bcf75be734a1302c3889e7 to your computer and use it in GitHub Desktop.
Employees max salary from each department
SELECT employee_name, department, salary
FROM employees e
WHERE salary = (
SELECT MAX(salary)
FROM employees
WHERE department = e.department
)
ORDER BY department;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment