今天讲一下错行函数(lag,lead)函数如何使用窗口函数。...Lag(exp_str,offset,defval) over()
Lead(exp_str,offset,defval) over()
--exp_str要取的列
--offset...取偏移后的第几行数据
--defval:没有符合条件的默认值
下面是表“test_student_score”的全部记录。...SQL> select t.subject_id,
t.subject_id,
lag(t.score, 1, -1) over(order by t.score) as lags...SQL> select t.subject_id,
t.subject_id,
lag(t.score, 1, -1) over(order by t.score) as lags