Combine rows when the end time of one is the start time of another (Oracle)

前端 未结 5 437
旧时难觅i
旧时难觅i 2021-01-18 15:49

I just can\'t seem to get this query figured out. I need to combine rows of time-consecutive states into a single state.

This question is similar to the question fou

5条回答
  •  广开言路
    2021-01-18 16:23

    You can do that with a recursive query (something with CONNECT BY / PRIOR in oracle, IIRC) I did the same thing for Postgres in this thread : Get total time interval from multiple rows if sequence not broken

    It might need a bit of reworking to make it fit into the oracle syntax.

提交回复
热议问题