Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 747 Bytes

_177. Nth Highest Salary.md

File metadata and controls

36 lines (26 loc) · 747 Bytes

All prompts are owned by LeetCode. To view the prompt, click the title link above.

Back to top


First completed : May 22, 2024

Last updated : July 01, 2024


Related Topics : Database

Acceptance Rate : 37.96 %


Solutions

SQL

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