Oracle sum of intervals ...


When timestamps are used in your tables and you subtract two timestamps then you will get as result a value of type "interval". And it is not possible to sum up intervals. But it can be done by casting to float. The only bad thing is that you will loose the milli seconds...

CAST((ts1 + 0) - (ts2 + 0) AS FLOAT)*24*60*60 /* seconds */http://www.rocworks.at/wordpress/?p=483

Last update:
2014-07-16 15:46
Author:
Andreas Vogler
Revision:
1.0
Average rating:0 (0 Votes)

You can comment this FAQ

Chuck Norris has counted to infinity. Twice.