CONDITIONAL_CHANGE_EVENT

functionsupportedCore SQL functions

docs.snowflake.com ↗

Window functions

Returns a window event number for each row within a window partition when the value of the argument expr1 in the current row is different from the value of expr1 in the previous row. The window event number starts from 0 and is incremented by 1 to indicate the number of changes so far within that window.

Syntax

supportedpartialnot supportednot scored

CONDITIONAL_CHANGE_EVENT( <expr1> ) OVER ( [ PARTITION BY <expr2> ] ORDER BY <expr3> [ { ASC | DESC } ] [ NULLS { FIRST | LAST } ] )

Parameters

NameRequiredDescription
expr1requiredThis is an expression that gets compared with the expression of the previous row.
expr2requiredThis is the optional expression to partition by.
expr3requiredThis is the expression to order by within each partition.

Usage notes