我希望从类似于此论坛的列中计算总时间:
https://stackoverflow.com/questions/3054943/calculate-sum-time-with-mysql
这是我的代码不起作用:
SEC_TO_TIME(SUM(TIME_TO_SEC(CASE WHEN (SUBSTR(Total_Time,1,2) -
SUBSTR(ActivityTime,1,2)) < 0
THEN '0' || DATEDIFF(hh,Total_Time,ActivityTime)-1 || ':' || DATEDIFF(mi,Total_Time,ActivityTime)
WHEN (SUBSTR(Total_Time,1,2) - SUBSTR(ActivityTime,1,2)) >= 0
THEN '0' || DATEDIFF(hh,Total_Time,ActivityTime) || ':' ||
DATEDIFF(mi,Total_Time,ActivityTime)
END))) AS TotalVariance,
任何帮助都会很棒!谢谢!