Re: Formatting seconds in MM:SS
Date: Tue, 04 Mar 2008 07:35:09 +0100
Jens Riedel schrieb:
> I need to display a number of seconds in the <minutes>:<seconds>
> notation, e.g. 100 seconds shall return '01:40'.
> Hours shall NOT be displayed, so for example 7201 seconds shall return
> '120:01', not '02:00:01'...
> Has anyone a hint how I can achieve this?
> Thanx and best regards,
You already got some ideas how to solve your problem, just in case, your input is not time but simply a number of seconds, you can do something like this
SQL> with t as (
2 select 100 s from dual union all
3 select 7201 from dual)
4 select s,trunc(s/60)||':'||mod(s,60) "M:S" from t;
100 1:40 7201 120:1
Maxim Received on Tue Mar 04 2008 - 00:35:09 CST