今天讲一下错行函数(lag,lead)函数如何使用窗口函数。...Lag(exp_str,offset,defval) over()
Lead(exp_str,offset,defval) over()
--exp_str要取的列
--offset...先看一下不用这两个函数式的原始输出:
SQL> select * from test_student_score t where t.subject_id = 3;
STUDENT_ID SUBJECT_ID...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