> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# microseconds_sub

> 从日期时间中减去指定的微秒数。

从 `expr1` 中减去指定的时间间隔，单位为微秒。

## 语法

```Haskell theme={null}
DATETIME microseconds_sub(DATETIME expr1,INT expr2);
```

## 参数说明

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

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

## 返回值说明

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

## 示例

```Plain Text theme={null}
select microseconds_sub('2010-11-30 23:50:50', 2);
+--------------------------------------------+
| microseconds_sub('2010-11-30 23:50:50', 2) |
+--------------------------------------------+
| 2010-11-30 23:50:49.999998                 |
+--------------------------------------------+

select microseconds_sub('2010-11-30', 2);
+-----------------------------------+
| microseconds_sub('2010-11-30', 2) |
+-----------------------------------+
| 2010-11-29 23:59:59.999998        |
+-----------------------------------+
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.