177. Nth Highest Salary

问题描述

解决方案

CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN 
    declare number int; 
    set number=N-1; 
    return   (select distinct Salary from Employee order by Salary desc limit number,1);
END

posted @ 2016-08-11 14:15  弦断  阅读(144)  评论(0编辑  收藏  举报