I\'m working on oracle db and I\'m not quite good at Oracle. I\'m trying to split a row by one hour period.
For example, if a time row has given as below,
St
I have bulit a basic query, you can work around it and get what you want.
select greatest(Start_time, trunc(Start_time+(level-1)/24, 'hh24')),
least(End_time, trunc(Start_time+(level)/24, 'hh24'))
from log_table
connect by level <= floor((dt1-dt2)*24)+1;
Example at sqlfiddle:
http://sqlfiddle.com/#!4/82625/29