CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
Declare m int;
set m=N-1;
RETURN (
# Write your MySQL query statement below.
select ifnull(
(select distinct salary
from Employee
order by salary desc
limit m,1),NULL
)
);
END
BEGIN
Declare m int;
set m=N-1;
RETURN (
# Write your MySQL query statement below.
select ifnull(
(select distinct salary
from Employee
order by salary desc
limit m,1),NULL
)
);
END
0 Comments:
Post a Comment