DEV Community

Miss Pooja Anilkumar Patel
Miss Pooja Anilkumar Patel

Posted on • Updated on

177. Leetcode Solution in Mysql

CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
  SET N = N - 1;
  RETURN (
      # Write your MySQL query statement below.

      select distinct e.Salary
      from Employee e
      order by e.Salary desc
      limit N, 1

  );
END
Enter fullscreen mode Exit fullscreen mode

leetcode

challenge

here is the link for the problem:
https://leetcode.com/problems/nth-highest-salary/

Top comments (0)