177. Nth Highest Salary

CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
declare M int;
set M = N-1;
RETURN
(
# Write your MySQL query statement below.
select distinct salary from Employee order by salary desc limit M,1
);
END

posted @ 2018-10-24 20:02  ffeng0312  阅读(153)  评论(0)    收藏  举报