开发者

Time difference need to be added in start time

开发者 https://www.devze.com 2023-03-21 11:17 出处:网络
I hope any one will help me with this. I have two datetime start and end time . I get the time difference between two.

I hope any one will help me with this. I have two datetime start and end time . I get the time difference between two. eg.

Start Time   18/07/2011 08:49:48
End time 开发者_JAVA技巧    18/07/2011 08:49:52         
Diff         +000000000 00:00:04.000000000 ( 04 seconds)

i need to add this time difference to the start time like this

 18/07/2011 08:49:48 
,18/07/2011 08:49:49
,18/07/2011 08:49:50
,18/07/2011 08:49:51
,18/07/2011 08:49:52

In simple words , Need to add the time difference to the start time one by one. With that i need to do some other calculation.

Thanks in advance.


SELECT  CAST('18/07/2011 08:49:48' AS DATE) + (level - 1) / 86400
FROM    dual
CONNECT BY
        level <= (CAST('18/07/2011 08:49:52' AS DATE) - CAST('18/07/2011 08:49:48' AS DATE)) * 86400 + 1
0

精彩评论

暂无评论...
验证码 换一张
取 消