How to calculate a string (select '1 + 1' from dual;)
387548May 22 2006 — edited May 22 2006I have this system that gives me data (roughly a gig per hour) in the format:
Time_idle
13h 56m
56m 23s
24h 23m
4h 3m
4m 3s
I have to translate it into date, or desimal hour so I can use it in calculations and SQL.
How can I do this?
I have tried the following:
select RTRIM(REPLACE(REPLACE(REPLACE(REPLACE(time_idle,'h',''),'m','/60'),'s','/3600'),' ','+'),'+') from thedate where prosess = 1;
and I then get:
result:
10+54/60
14+12/60
54/60+1/3600
which is correct, if I could get Oracle to calculate the number sum instead of just providing me with the string value. How do I make Oracle calculate the value of the string?
Or how can I use to_date function to translate the text into a date?
Anyone know?
BB