33 - 连续出现的数字
-- 开窗函数lead(col,n) 统计窗口内往下第n行值
-- over(partition by xxx) 按照xxx所有行进行分组
-- over(partition by xxx order by aaa) 按照xxx分组,按照aaa排序select distinct num as ConsecutiveNums
from(select num,# 从当前记录获取前一行记录的num值,如果没有前一行,则返回nulllead(num,1) over(order by id) as a,# 从当前记录获取后一行记录的num值,如果没有后一行,则返回nulllead(num,2) over(order by id) as bfromlogs
) t
wherenum=a and num=b;