开发者

Difference between two SQL timestamp values

开发者 https://www.devze.com 2023-01-23 03:52 出处:网络
How can I find the difference between two SQL timestamp values in 开发者_运维百科minutes and seconds?Try the TIMEDIFF() function:

How can I find the difference between two SQL timestamp values in 开发者_运维百科minutes and seconds?


Try the TIMEDIFF() function:

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_timediff

Example:

mysql> select timediff('2010-11-03 15:30:00','2010-11-03 14:00:00') as diff;
+----------+
| diff     |
+----------+
| 01:30:00 |
+----------+


Use TIMEDIFF:

SELECT TIMEDIFF(ts1, ts2) FROM ...
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号