lag(value any [, offset integer [, default any ]])
SELECT z_myid, lag(z_myid) OVER (ORDER BY z_myid) BEFORE
FROM list
returns value evaluated at the row that is offset rows before the current row within the partition; if there is no such row, instead return default. Both offset and default are evaluated with respect to the current row. If omitted, offset defaults to 1 and default to null.
특정 컬럼의 이전 행의 값을 구하는 window function
lead(value any [, offset integer [, default any ]])
SELECT z_myid, lead(z_myid) OVER (ORDER BY z_myid) NEXT
FROM list
returns value evaluated at the row that is offset rows after the current row within the partition; if there is no such row, instead return default. Both offset and default are evaluated with respect to the current row. If omitted, offset defaults to 1 and default to null
특정 컬럼의 다음 행의 값을 구하는 window function