计算 expr1
- expr2
,结果精确到秒
seconds_diff(expr1,expr2);
expr1
: 支持的数据类型为 DATETIME
expr2
: 支持的数据类型为 DATETIME
返回值的数据类型为 BIGINT
mysql> select seconds_diff('2010-11-30 23:59:59', '2010-11-30 20:59:59');
+------------------------------------------------------------+
| seconds_diff('2010-11-30 23:59:59', '2010-11-30 20:59:59') |
+------------------------------------------------------------+
| 10800 |
+------------------------------------------------------------+
1 row in set (0.00 sec)