timestart
= 16:46:33
timeend
= 16:48:22
预期结果= 00:01:49
我的查询:
Select timestart , timeend, (timeend - timestart) as rangetime from time;
答案 0 :(得分:0)
检查MySQL TIMEDIFF功能。
试试这个:
SELECT timestart, timeend, TIMEDIFF(timeend, timestart) AS rangetime
FROM time;
答案 1 :(得分:0)
尝试使用SubTime
Select timestart , timeend, SUBTIME(timestart ,timeend) As rangetime from time;
<强> FIDDLE DEMO 强>
答案 2 :(得分:0)
select Timestart,Timeend,subtime(Timestart,Timeend) as rangetime from time;
答案 3 :(得分:0)
检查 TIMEDIFF 功能
试试这个
SELECT timestart,
timeend,
TIMEDIFF(timeend,timestart) AS rangetime
FROM `time`;