CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
DECLARE temp int;
SET temp = N-1;
RETURN (
# Write your MySQL query statement below.
SELECT DISTINCT Salary
FROM Employee
ORDER BY Salary DESC
LIMIT temp,1
);
END
原文:https://www.cnblogs.com/yuesi/p/10134929.html