跳到主要内容
版本:3.3

microseconds_add

功能​

向 expr1 添加指定的时间间隔,单位为微秒。

语法​

DATETIME microseconds_add(DATETIME expr1,INT expr2);

参数说明​

expr1: 支持的数据类型为 DATETIME。

expr2: 支持的数据类型为 INT,单位为微秒。

返回值说明​

返回值的数据类型为 DATETIME。如果输入值为 DATE 类型,则时-分-秒部分默认按照 00:00:00 处理。

示例​

select microseconds_add('2010-11-30 23:50:50', 2);
+--------------------------------------------+
| microseconds_add('2010-11-30 23:50:50', 2) |
+--------------------------------------------+
| 2010-11-30 23:50:50.000002 |
+--------------------------------------------+
1 row in set (0.00 sec)

select microseconds_add('2010-11-30', 2);
+-----------------------------------+
| microseconds_add('2010-11-30', 2) |
+-----------------------------------+
| 2010-11-30 00:00:00.000002 |
+-----------------------------------+
Rocky the happy otterStarRocks Assistant

AI generated answers are based on docs and other sources. Please test answers in non-production environments.