南大通用GBase 8a数据库两个时间相差的秒数

GBase 8a 数据库集群提供了timediff函数,返回2个时间相差的秒数。最大单位是小时。


gbase> select timediff('12:13:14.123456','13:14:15.234567');
+-----------------------------------------------+
| timediff('12:13:14.123456','13:14:15.234567') |
+-----------------------------------------------+
| -01:01:01.111111                              |
+-----------------------------------------------+
1 row in set (Elapsed: 00:00:00.00)

gbase> select timediff('2020-01-02 12:13:14.123456','2020-01-03 13:14:15.234567');
+---------------------------------------------------------------------+
| timediff('2020-01-02 12:13:14.123456','2020-01-03 13:14:15.234567') |
+---------------------------------------------------------------------+
| -25:01:01.111111                                                    |
+---------------------------------------------------------------------+
1 row in set (Elapsed: 00:00:00.00)

GBase 8a数据库两个日期相差的年月日星期小时分等

南大通用GBase 8a数据库两个时间相差的秒数》有1条评论

评论已关闭。