I have this table and need to find gaps between intervals
Records may be overlapping.
user | start_time | end_time
user1|2018-09-26T02:16:52.023453|2018-09-26T03:12:04.404477
user1|2018-09-25T22:15:49.593296|2018-09-26T00:15:52.016497
user1|2018-09-25T20:13:02.358192|2018-09-25T22:15:49.593296
Expected output will be
user | start_time | end_time
user1|2018-09-26T00:15:52.016497|2018-09-26T02:16:52.023453
LEAD
andLAG
- postgresql.org/docs/9.6/static/functions-window.html – Nimitz