SQL查询语句中的 limit 与 offset 的区别:
limit y 分句表示: 读取 y 条数据limit x, y 分句表示: 跳过 x 条数据,读取 y 条数据
limit y offset x 分句表示: 跳过 x 条数据,读取 y 条数据
练习题:leetcode[176]第二高的薪水
查询语句:
select(select distinct Salary
from Employee
order by Salary DESC
limit 1 offset 1)
as SecondHighestSalary;