浏览器标题切换
浏览器标题切换end

LeetCode数据库176 - 第二高的薪水 - limit offset用法

题目链接

https://leetcode-cn.com/problems/second-highest-salary/

题解

注意几个sql语句的用法即可。

ifnull、desc、limit offset的用法见:https://www.cnblogs.com/OFSHK/p/14636382.html

AC代码

select ifnull(
(select distinct Salary from Employee
order by Salary desc
limit 1 offset 1),null) as SecondHighestSalary;
posted @ 2021-04-10 10:44  抓水母的派大星  阅读(60)  评论(0)    收藏  举报