It would be useful, for example, if we want to join previous entity state to current state.
CREATE TABLE states (
entity_id UUID
state INT8
timestamp DateTime
)
SELECT state AS cur_state, prev_state FROM states ASOF JOIN states AS prev_states ON states.entity_id = prev_states.entity_id AND states.timestamp > prev_states.timestamp ORDER BY timestamp DESC LIMIT 10;
+1. Need this functionality.
How to implement:
>= logic depending on saved comparison type here https://github.com/yandex/ClickHouse/blob/master/dbms/src/Interpreters/RowRefs.cpp#L75At the point 4 upper_bound is >=, lower_bound would be equal to <=. For strict comparison we need "upper_bound/lower_bound but not equal" logic.
Most helpful comment
7282