2022-02-18 02:35:04 +00:00
|
|
|
|
---
|
2022-08-26 19:07:59 +00:00
|
|
|
|
slug: /zh/sql-reference/statements/alter/delete
|
2022-04-10 23:08:18 +00:00
|
|
|
|
sidebar_position: 39
|
|
|
|
|
sidebar_label: DELETE
|
2022-02-18 02:35:04 +00:00
|
|
|
|
---
|
|
|
|
|
|
2022-02-18 02:39:57 +00:00
|
|
|
|
# ALTER TABLE … DELETE 语句 {#alter-mutations}
|
2022-02-18 02:35:04 +00:00
|
|
|
|
|
|
|
|
|
``` sql
|
|
|
|
|
ALTER TABLE [db.]table [ON CLUSTER cluster] DELETE WHERE filter_expr
|
|
|
|
|
```
|
|
|
|
|
|
2022-02-18 02:39:57 +00:00
|
|
|
|
删除匹配指定过滤表达式的数据。实现为[突变](../../../sql-reference/statements/alter/index.md#mutations).
|
2022-02-18 02:35:04 +00:00
|
|
|
|
|
2023-03-03 10:35:07 +00:00
|
|
|
|
:::note
|
|
|
|
|
`ALTER TABLE`前缀使得这个语法不同于大多数其他支持SQL的系统。它的目的是表示,与OLTP数据库中的类似查询不同,这是一个不为经常使用而设计的繁重操作。
|
|
|
|
|
:::
|
2022-02-18 02:35:04 +00:00
|
|
|
|
|
2022-02-18 02:39:57 +00:00
|
|
|
|
`filter_expr` 的类型必须是`UInt8`。该查询删除表中该表达式接受非零值的行。
|
2022-02-18 02:35:04 +00:00
|
|
|
|
|
2022-02-18 02:39:57 +00:00
|
|
|
|
一个查询可以包含多个用逗号分隔的命令。
|
2022-02-18 02:35:04 +00:00
|
|
|
|
|
2022-02-18 02:39:57 +00:00
|
|
|
|
查询处理的同步性由[mutations_sync](../../../operations/settings/settings.md#mutations_sync)设置定义。缺省情况下,是异步的。
|
2022-02-18 02:35:04 +00:00
|
|
|
|
|
2022-02-18 02:39:57 +00:00
|
|
|
|
**详见**
|
2022-02-18 02:35:04 +00:00
|
|
|
|
|
2022-02-18 02:39:57 +00:00
|
|
|
|
- [突变](../../../sql-reference/statements/alter/index.md#mutations)
|
|
|
|
|
- [ALTER查询的同步性](../../../sql-reference/statements/alter/index.md#synchronicity-of-alter-queries)
|
2022-02-18 02:35:04 +00:00
|
|
|
|
- [mutations_sync](../../../operations/settings/settings.md#mutations_sync) setting
|