Answers for "mysql get nth highest"

SQL
0

mysql get nth highest

CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
  SET N = N-1;
  
  RETURN (
      # Where Salary is your column name and Employee your table
      SELECT DISTINCT(Salary) FROM Employee ORDER BY Salary DESC LIMIT N, 1
  );
END
Posted by: Guest on May-15-2021

Code answers related to "mysql get nth highest"

Code answers related to "SQL"

Browse Popular Code Answers by Language