I'd like to calculate in SQL server the cycle time in seconds of each ocurrance.
It's the difference between the current row 'TimeCol' and the following 'TimeCol'.
The desired answer is to have a calculated column that show the time spent on the current model.
TimeCol model_code cycle_seconds
2021-07-08 16:02:25 9011 185
2021-07-08 16:05:30 9016 484623
2021-07-14 06:42:33 9016 0
2021-07-14 06:42:33 9011 31
2021-07-14 06:43:04
Any help will be much appreciated, Thanks.