踏踏实实积累,不要浮躁
今天刷LeetCode上的数据库题目 176 https://leetcode-cn.com/problems/second-highest-salary/
题目要求是 : 找出表中 第二高的薪水
select IFNULL(( select distinict salary desc limit 1 offset 1 ) ,NULL) as SecondHighestSalary
说明 sql中 offset 用法是 跳过几行元素 上面的意思就是 跳过第一行 然后limit 表示取第一条记录
本人一直写 Hive sql 对这种 offset的用法之前还不知道 ,孤陋寡闻了。得多学习