我的查询是我想找到timediff函数的总和任何帮助
SELECT TIMEDIFF( timefrom, timeto )
FROM `leaveapply`
WHERE userid = '21'
GROUP BY leavetype
LIMIT 0 , 30
以下语句将返回这样的时间
00:00:00
00:00:00
01:00:00
02:00:00
我想总结并得到结果,
像这样03:00:00
答案 0 :(得分:0)
尝试这样的事情:
select sum(
SELECT TIMEDIFF( timefrom, timeto ) FROM `leaveapply`
WHERE userid = '21'
GROUP BY leavetype
) as total