Instruction
Excellent!! That's all we wanted to teach you today. Let's review what we've learned:
LEAD(x)andLAG(x)give you the next/previous value in the column x, respectively.LEAD(x,y)andLAG(x,y)give you the value in the column x of the row which is y rows after/before the current row, respectively.FIRST_VALUE(x)andLAST_VALUE(x)give you the first and last value in the column x, respectively.NTH_VALUE(x,n)gives you the value in the column x of the n-th row.LAST_VALUEandNTH_VALUEusually require the window frame to be set toROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
Now, are you ready for a short quiz?
Exercise
Press to start.



