Postgresql – SQL query to identify continuous events that satisfy a condition group by product id
I have data that looks as follows. timestamp productid measure 2022-01-01 00:00:00 1 4 2022-01-01 00:01:00 1 5 2022-01-01 00:02:00 1 6 2022-01-01 00:01:00 2 5 2022-01-01 00:00:00 2 7 2022-01-01 00:01:00 3 9 The table records the telemetry of…