Hello I need to intersect two tables with interval dates
Timeline 1
start | end
---------------------------------------------
2016-12-19 08:00:00 | 2016-12-19 08:30:00
2016-12-19 09:30:00 | 2016-12-19 11:00:00
Timeline 2
start | end
---------------------------------------------
2016-12-19 08:30:00 | 2016-12-19 10:00:00
2016-12-19 10:30:00 | 2016-12-19 11:00:00
here's SQL i tried:
SELECT * FROM start, end FROM timeline1
INTERSECT
SELECT * FROM start, end FROM timeline2
need result like this:
Total: 00:60:00
Use range operators * and &&:
Sum of intervals: