【发布时间】:2021-11-09 12:50:06
【问题描述】:
我希望能够为特定行插入空值,而不是默认情况下 例如: 我希望能够为年龄插入空值,但如果未指定,则默认值为 10。
create table mytable
(
age Int null default 10,
name String
) ENGINE = MergeTree()
ORDER BY name
结果
Code: 62, e.displayText() = DB::Exception: Syntax error: failed at position 88 ('default') (line 3, col 26): default 10,
name String
) ENGINE = MergeTree()
ORDER BY name. Expected one of: CODEC, TTL, ClosingRoundBracket, Comma, COMMENT, token (version 21.8.10.19 (official build))
documentation 说:
NULL is the default value for any Nullable type, unless specified otherwise in the ClickHouse server configuration.
我想我必须在这个page 上找到正确的设置,否则我误解了默认值和 Nullable 类型之间的关系......
【问题讨论】:
标签: clickhouse