I\'m having a data column named test_duration bigint(12). I\'m storing time in seconds into the database. Now when I fetch record from the table I want the
The max value that you can get from the function SEC_TO_TIME is 838:59:59
If you have bigger number you can use this code:
SELECT DAY, Floor((SUM(DAY) / (60*60))) AS Hours,
Floor(MOD(SUM(DAY), (60*60)) / 60) AS Minutes,
Floor(MOD(SUM(DAY), (60))) AS Secs,
CONCAT(
Floor((SUM(DAY) / (60*60))), ":",
Floor(MOD(SUM(DAY), (60*60)) / 60), ":",
Floor(MOD(SUM(DAY), (60)))
) AS Time
FROM (SELECT 5328089 as DAY) a