Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 387 Bytes

177.md

File metadata and controls

27 lines (19 loc) · 387 Bytes

Nth Highest Salary

Description

link


Solution

See Code


Code

CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
DECLARE M INT;
SET M=N-1;
  RETURN (
      # Write your MySQL query statement below.
      SELECT DISTINCT Salary FROM Employee ORDER BY Salary DESC LIMIT M, 1
  );
END