Hi everyone
I am looking for a way to get the the first and the last row from consecutive rows which have the same value in specific columns:
The data is defined as follows:
CREATE TABLE IF NOT EXISTS t
(
device String,
timestamp UInt64,
key String
)
ENGINE = ReplacingMergeTree()
ORDER BY (device, timestamp)
now i'd like to get the first and the last row where device and key are the same for consecutive rows.
I'd be happy to use aggregation but I don't see how to achive this.
Anyone has an idea?
Cheers This