{ current_expr operator LAG (previous_expr, lag_rows [, default]) | LAG (previous_expr, lag_rows [, default]) operator current_expr }
where:
- current_expr is the name of a column from the current row (or an expression operating on this column).
- operator is either >, >=, <, <=, =, or <>
- previous_expr is the name of a column from a previous row (or an expression operating on this column).
- lag_rows is the number of rows to count backward from the current row to reach the previous row. For example, if lag_rows is 1, the previous row is the immediately preceding row.
- default is the value to use for previous_expr when there is no previous row (that is, when the current row is the first row or there is no row that is lag_rows before the current row).