Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
运行查询后,我在 MySQL 中得到如下列
TimeDiff 03:45:07 03:28:59 00:36:16 00:59:42 02:44:18
现在我想在同一个查询中一起总结时间。示例查询如下所示
SELECT timediff(OutTime, InTime) AS TimeDiff FROM Table1
我尝试了 Sum 和 SEC_TO_TIME 但我以错误的方式使用。
请让我知道如何总结获得 11:53:33 的时间
SELECT SEC_TO_TIME(SUM(tbl.TimeDiff)) as TimeDifferent FROM (SELECT TIME_TO_SEC(timediff(OutTime, InTime)) AS TimeDiff FROM Table1) as tbl