01|xxx |07:30|16:00 |aaa |12:00|12:30 |bbb |13:00|14:00 |null |null |null
02|yyy |07:30|16:00 |aaa |13:00|14:30 |null |null |null |null |null |null
03|zzz |08:00|17:00 |aaa |08:00|14:30 |ccc |12:30|13:00 |ddd |15:00|16:30
01|07:30 |xxx |12:00 |aaa |12:30 |xxx |13:00 |bbb |14:00 |xxx |16:00 |null|null |null
02|07:30 |yyy |13:00 |aaa |14:30 |yyy |16:00 |null|null |null|null |null|null |null
03|08:00 |aaa |12:30 |ccc |13:00 |aaa |14:30 |zzz |15:00 |ddd |16:30 |zzz |17:00|null
i have a scenario like below.
A table has values like main value and sub values with respective start and end time. wherever the gaps in the time for subvalues i have to fill up with main value.
The process happens within the same row by comparing subsequent columns.
Is there any way to achive this in SQL?
Any input on this. Is there any way to do it in sql.
Please help to solve this. Thanks in advance .