1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| SELECT TO_CHAR (FLOOR (moyenne_en_secondes / 3600)) AS heures,
TO_CHAR (MOD (moyenne_en_secondes - MOD (moyenne_en_secondes, 60), 3600) / 60
) AS minutes,
TO_CHAR (MOD (moyenne_en_secondes, 60)) AS secondes
FROM (SELECT AVG ( TO_NUMBER (SUBSTR ('44:55:32', 1,
INSTR ('44:55:32', ':', 1, 1) - 1)
) * 3600
+ TO_NUMBER (SUBSTR ('44:55:32',
INSTR ('44:55:32', ':', 1, 1) + 1,
INSTR ('44:55:32', ':', 1, 2)
- INSTR ('44:55:32', ':', 1, 1)
- 1 )) * 60
+ SUBSTR ('44:55:32', INSTR ('44:55:32', ':', 1, 2) + 1)
) AS moyenne_en_secondes
FROM dual); |
Partager