我们怎样在 MySQL 中计算两个时间值之差?
借助 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)
广告