Created
May 18, 2020 08:33
-
-
Save indatawetrust/8f908c73d8c25ac2509836630ff180c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT | |
BEGIN | |
DECLARE _N INT; | |
SET _N = N - 1; | |
RETURN ( | |
# Write your MySQL query statement below. | |
select ( | |
select distinct Salary from Employee order by Salary desc limit 1 offset _N | |
) as getNthSalary | |
); | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment