I know that I can use LAG
and LEAD
to get the previous and subsequent rows from a results set. What I want to know is how to get the subsequent row, and the row after that one, and the next row. I don't want to use a cursor if pivot, if possible.
Is it possible to LEAD(n)
with n being the number of rows ahead?