> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8c05c8a2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Documentation for ALTER TABLE ... UPDATE Statements

# ALTER TABLE ... UPDATE Statements

```sql theme={null}
ALTER TABLE [db.]table [ON CLUSTER cluster] UPDATE column1 = expr1 [, ...] [IN PARTITION partition_id] WHERE filter_expr
```

Manipulates data matching the specified filtering expression. Implemented as a [mutation](/reference/statements/alter/index#mutations).

<Note>
  The `ALTER TABLE` prefix makes this syntax different from most other systems supporting SQL. It is intended to signify that unlike similar queries in OLTP databases this is a heavy operation not designed for frequent use.
</Note>

The `filter_expr` must be of type `UInt8`. This query updates values of specified columns to the values of corresponding expressions in rows for which the `filter_expr` takes a non-zero value. Values are cast to the column type using the `CAST` operator. Updating columns that are used in the calculation of the primary or the partition key is not supported.

One query can contain several commands separated by commas.

The synchronicity of the query processing is defined by the [mutations\_sync](/reference/settings/session-settings#mutations_sync) setting. By default, it is asynchronous.

**See also**

* [Mutations](/reference/statements/alter/index#mutations)
* [Synchronicity of ALTER Queries](/reference/statements/alter/index#synchronicity-of-alter-queries)
* [mutations\_sync](/reference/settings/session-settings#mutations_sync) setting
* [Lightweight `UPDATE`](/reference/statements/update) - Alternative lightweight update using patch parts
* [`APPLY PATCHES`](/reference/statements/alter/apply-patches) - Manually apply patches from lightweight updates

<h2 id="related-content">
  Related content
</h2>

* Blog: [Handling Updates and Deletes in ClickHouse](https://clickhouse.com/blog/handling-updates-and-deletes-in-clickhouse)
