Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 731 Bytes

File metadata and controls

33 lines (22 loc) · 731 Bytes

seconds_diff

功能

计算 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)