Postgresql – SQL How to determine the duration of the action based on the current and next event?
I have a table with two columns: the action start time and the name of action. time action 2023-07-27 04:52:00.000 running 2023-07-27 04:55:00.000 walking 2023-07-27 04:59:00.000 walking 2023-07-27 05:01:00.000 sitting 2023-07-27 05:06:00.000 walking 2023-07-27 05:10:00.000 running I need to know…