Mysql表列是
Starttime - type:datetime, Stoptime - type:datetime
数据
Starttime, stoptime
2013-10-25 09:00:00, 2013-10-25 17:00:00
2013-10-26 09:00:00, 2013-10-26 17:00:00
2013-10-27 09:00:00, 2013-10-27 17:00:00
2013-10-28 09:00:00, 2013-10-28 17:45:00
询问
select, min(starttime), max(stoptime),
SUM(TIME_TO_SEC(TIME_DIFF(stoptime - starttime))) total_hours from mytable
返回秒数,我可以使用...将其转换回时间TIME_TO_SEC()
...它以格式为我提供结果,HH:MM:SS
例如 28:45:00
但我需要将 28:45:00 转换为 28.75 小时格式。我怎么做?