Updated on 2024-10-09 GMT+08:00

ALTER COLUMN

This topic is available for MRS 3.3.0 and later versions.

Function

This command is used to change the default values of a column.

Syntax

ALTER TABLE tableIdentifier ALTER COLUMN colName SET DEFAULT defaultValue

Parameters

Table 1 ADD COLUMNS parameters

Parameter

Description

tableIdentifier

ClickHouse table name

colName

Column Name

defaultValue

Default value of a column

Example

alter table h0_1 alter column extl set default 'new_default_value';

Response

You can view query results on the client.