Skip to content

Instantly share code, notes, and snippets.

@manas5110
Created May 27, 2018 04:16
Show Gist options
  • Save manas5110/8cda8bc262f75cbd697c20cf8ea2dbba to your computer and use it in GitHub Desktop.
Save manas5110/8cda8bc262f75cbd697c20cf8ea2dbba to your computer and use it in GitHub Desktop.
Employee
select manager_id, employee_id, salary from (select manager_id, employee_id, salary, rank() over(partition by manager_id order by salary desc) as r from employees) where r=1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment