SelectDB Cloud
SQL 手册
SQL 函数
日期函数
MILLISECONDS_DIFF

milliseconds_diff

description

Syntax

INT milliseconds_diff(DATETIME enddate, DATETIME startdate)

开始时间到结束时间相差几毫秒

example

mysql> select milliseconds_diff('2020-12-25 21:00:00.623000','2020-12-25 21:00:00.123000');
+-----------------------------------------------------------------------------------------------------------------------------+
| milliseconds_diff(cast('2020-12-25 21:00:00.623000' as DATETIMEV2(6)), cast('2020-12-25 21:00:00.123000' as DATETIMEV2(6))) |
+-----------------------------------------------------------------------------------------------------------------------------+
|                                                                                                                         500 |
+-----------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.03 sec)

keywords

milliseconds_diff
© 2023 北京飞轮数据科技有限公司 京ICP备2022004029号 | Apache、Apache Doris 以及相关开源项目名称均为 Apache 基金会商标