借助 TIMEDIFF() MySQL 函数,可以计算两个时间值之间的差异。
示例
mysql> Select TIMEDIFF('04:05:45','03:05:45') AS ‘Difference in Time’;
+---------------------------------+
| Difference in Time |
+---------------------------------+
| 01:00:00 |
+---------------------------------+
1 row in set (0.00 sec)