76. Second Highest Salary

https://leetcode.com/problems/second-highest-salary/solution/
two row has the same salary, should return null, so we use distinct salary

SELECT IFNULL( (SELECT DISTINCT Salary FROM Employee ORDER BY Salary DESC LIMIT 1 OFFSET 1), NULL) AS SecondHighestSalary
posted @ 2018-10-23 20:11  ffeng0312  阅读(84)  评论(0)    收藏  举报