I have a requirement to compute from below table to arrive timeslots for each door group ID like
1) 0:00 ~ 1:00 (after adding :30 to the last value)
2) 17:00 ~ 00:00.
Basically if the timesegment row value differences are more than 30 mins then those are separate slots having a different shift start time and all slots in the below table are 30 mins slots. Any pointers to this will be helpful.
| doorgroupid | weekday | timesegment | active |
| 10 | 1 | 0:00 | T |
| 10 | 1 | 0:30 | T |
| 10 | 1 | 17:00 | T |
| 10 | 1 | 17:30 | T |
| 10 | 1 | 18:00 | T |
| 10 | 1 | 18:30 | T |
| 10 | 1 | 19:00 | T |
| 10 | 1 | 19:30 | T |
| 10 | 1 | 20:00 | T |
| 10 | 1 | 20:30 | T |
| 10 | 1 | 21:00 | T |
| 10 | 1 | 21:30 | T |
| 10 | 1 | 22:00 | T |
| 10 | 1 | 22:30 | T |
| 10 | 1 | 23:00 | T |
| 10 | 1 | 23:30 | T |