CREATE FUNCTION 的用法

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

  

posted on 2019-10-08 22:08  miss_林  阅读(3664)  评论(0编辑  收藏  举报

导航