Skip to content

Latest commit

 

History

History
14 lines (12 loc) · 262 Bytes

177-nth-highest-salary.md

File metadata and controls

14 lines (12 loc) · 262 Bytes

第N高的薪水

mysql实现

CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
  SET N = N - 1;
  RETURN (
      # Write your MySQL query statement below.
	  select distinct Salary from Employee order by Salary DESC limit N, 1
  );
END