语法为:TIMESTAMPDIFF(unit,datetime_expr1,datetime_expr2),
SELECT TIMESTAMPDIFF(SECOND, now(), '2014-01-27 15:52:11')
其中unit单位有如下几种,分别是:
FRAC_SECOND (microseconds),
SECOND,
MINUTE,
HOUR,
DAY,
WEEK,
MONTH,
QUARTER,
YEAR。
本文共 263 字,大约阅读时间需要 1 分钟。
语法为:TIMESTAMPDIFF(unit,datetime_expr1,datetime_expr2),
SELECT TIMESTAMPDIFF(SECOND, now(), '2014-01-27 15:52:11')
其中unit单位有如下几种,分别是:
FRAC_SECOND (microseconds),
SECOND,
MINUTE,
HOUR,
DAY,
WEEK,
MONTH,
QUARTER,
YEAR。
转载于:https://my.oschina.net/u/582827/blog/373597