leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE |
0177.sql (216B)
0 CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
1 BEGIN
2 DECLARE M INT;
3 SET M = N - 1;
4 RETURN (
5 SELECT DISTINCT salary
6 FROM Employee
7 ORDER BY salary DESC
8 LIMIT 1
9 OFFSET M
10 );
11 END