fixed the given examples of nullable in zh doc

This commit is contained in:
rainbowsysu 2019-10-24 20:07:10 +08:00
parent 18a72fa91a
commit 08788e3443

View File

@ -19,37 +19,21 @@
## 用法示例 ## 用法示例
```sql
CREATE TABLE t_null(x Int8, y Nullable(Int8)) ENGINE TinyLog
``` ```
:) CREATE TABLE t_null(x Int8, y Nullable(Int8)) ENGINE TinyLog ```sql
INSERT INTO t_null VALUES (1, NULL), (2, 3)
CREATE TABLE t_null ```
( ```sql
x Int8, SELECT x + y FROM t_null
y Nullable(Int8) ```
) ```text
ENGINE = TinyLog
Ok.
0 rows in set. Elapsed: 0.012 sec.
:) INSERT INTO t_null VALUES (1, NULL)
INSERT INTO t_null VALUES
Ok.
1 rows in set. Elapsed: 0.007 sec.
:) SELECT x + y FROM t_null
SELECT x + y
FROM t_null
┌─plus(x, y)─┐ ┌─plus(x, y)─┐
│ ᴺᵁᴸᴸ │ │ ᴺᵁᴸᴸ │
│ 5 │ │ 5 │
└────────────┘ └────────────┘
2 rows in set. Elapsed: 0.144 sec.
``` ```
[来源文章](https://clickhouse.yandex/docs/en/data_types/nullable/) <!--hide-->