Skip to Main Content

SQL Query Split hourly transactions into 12 equal interval

3761050Aug 13 2018 — edited Aug 21 2018

Hi All,

I have query output as below , i have all the transaction in hourly level need to split the records into 12 equal 5 minutes intervals    

volume/12   Start date and end date into 12 equal interval ( when splitting into 5 mins in excepted output 00:00:00 00:05:00 ( is intentional) even though its not exactly 5 mins

any help to approach this problem is appreciated

current Query output

S.NoStart_date
End_date
Volume
12018-04-01 00:00:002018-04-01 01:00:00120
22018-04-01 00:00:002018-04-01 01:00:00240
32018-04-01 02:00:002018-04-01 03:00:00240
42018-04-01 04:00:002018-04-01 05:00:00360

Excepted output  for ROW1 from the above table

S.NoStart_date
End_date
Volume
12018-04-01 00:00:002018-04-01 00:05:0010
22018-04-01 00:05:002018-04-01 00:10:0010
32018-04-01 00:10:002018-04-01 00:15:0010
42018-04-01 00:15:002018-04-01 00:20:0010
52018-04-01 00:20:002018-04-01 00:25:0010
62018-04-01 00:25:002018-04-01 00:30:0010
72018-04-01 00:30:002018-04-01 00:35:0010
82018-04-01 00:35:002018-04-01 00:40:0010
92018-04-01 00:40:002018-04-01 00:45:0010
102018-04-01 00:45:002018-04-01 00:50:0010
112018-04-01 00:50:002018-04-01 00:55:0010
122018-04-01 00:55:002018-04-01 01:00:0010
This post has been answered by Etbin on Aug 13 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked due to inactivity on Sep 18 2018
Added on Aug 13 2018
6 comments
188 views