MySQL: calculate overlapping periods
|
ort_rule_id |
factor |
user_name |
shift_id |
shift_start |
shift_end |
shift_duration_hours |
overlap_start |
overlap_end |
overlap_duration_hours |
1 |
1 |
1,2 |
Derrick |
8 |
09.12.2014 15:00:00 |
10.12.2014 06:12:27 |
15,21 |
09.12.2014 18:00:00 |
09.12.2014 23:59:59 |
6,00 |
2 |
2 |
1,2 |
Derrick |
8 |
09.12.2014 15:00:00 |
10.12.2014 06:12:27 |
15,21 |
10.12.2014 00:00:00 |
10.12.2014 01:00:00 |
1,00 |
3 |
3 |
1,3 |
Derrick |
8 |
09.12.2014 15:00:00 |
10.12.2014 06:12:27 |
15,21 |
10.12.2014 01:00:00 |
10.12.2014 03:00:00 |
2,00 |
4 |
2 |
1,2 |
Derrick |
8 |
09.12.2014 15:00:00 |
10.12.2014 06:12:27 |
15,21 |
10.12.2014 03:00:00 |
10.12.2014 05:00:00 |
2,00 |
5 |
1 |
1,2 |
Kevin |
2 |
09.12.2014 15:00:00 |
10.12.2014 00:00:00 |
9,00 |
09.12.2014 18:00:00 |
09.12.2014 23:59:59 |
6,00 |
6 |
1 |
1,2 |
Michael |
7 |
09.12.2014 15:00:00 |
10.12.2014 00:30:00 |
9,50 |
09.12.2014 18:00:00 |
09.12.2014 23:59:59 |
6,00 |
7 |
2 |
1,2 |
Michael |
7 |
09.12.2014 15:00:00 |
10.12.2014 00:30:00 |
9,50 |
10.12.2014 00:00:00 |
10.12.2014 00:30:00 |
0,50 |
|
λ
.NET NoSQL database for rapid development
|