📅  最后修改于: 2022-03-11 15:05:14.159000             🧑  作者: Mango
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
SET N = N-1;
RETURN (
# Where Salary is your column name and Employee your table
SELECT DISTINCT(Salary) FROM Employee ORDER BY Salary DESC LIMIT N, 1
);
END