SQL Converter minutes to hour: minute: seconds

2

How to convert a value in minutes in oracle to the format hour: minutes: seconds?

    
asked by anonymous 29.02.2016 / 13:40

1 answer

4

Converts minutes to hour: min: sec format, eg 1000 minutes converted would be 16:40:00

SELECT 
   TO_CHAR(TRUNC((MINUTES * 60) / 3600), 'FM9900') || ':' ||
   TO_CHAR(TRUNC(MOD((MINUTES * 60), 3600) / 60), 'FM00') || ':' ||
   TO_CHAR(MOD((MINUTES * 60), 60), 'FM00') AS MIN_TO_HOUR FROM DUAL
    
29.02.2016 / 13:40