Assigns an event window number to each row, starting from 0, and increments by 1 when the result of evaluating the argument expression on the current row differs from that on the previous row.
CONDITIONAL_CHANGE_EVENT ( expression ) OVER ( [ window-partition-clause ] window-order-clause )
SQL scalar expression that is evaluated on an input record. The result of expression can be of any data type.
The analytic window-order-clause is required but the window-partition-clause is optional.
=> SELECT CONDITIONAL_CHANGE_EVENT(bid) OVER (PARTITION BY symbol
ORDER BYts) AS cce FROM TickStore;
The system returns an error when no
ORDER BY clause is present:
=> SELECT CONDITIONAL_CHANGE_EVENT(bid) OVER (PARTITION BY symbol) AS cce FROM TickStore; ERROR: conditional_change_event must contain an ORDER BY clause within its analytic clause
For more examples, see Event-Based Windows in Analyzing Data.