Answers for "find nth highest salary in mysql"

SQL
2

2nd highest salary in mysql

#2nd Most highest salary using Limit & Order By
SELECT Salary FROM (SELECT Salary FROM Employee ORDER BY salary DESC LIMIT 2) AS Emp ORDER BY salary LIMIT 1;
Posted by: Guest on November-06-2020
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 "find nth highest salary in mysql"

Code answers related to "SQL"

Browse Popular Code Answers by Language