Skip to content

Commit

Permalink
chore: the ZH doc of adding multiple columns (#1470)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicecui authored Jan 14, 2025
1 parent 7d11389 commit 7f8a917
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ ALTER DATABASE db UNSET 'ttl';

```sql
ALTER TABLE [db.]table
[ADD COLUMN name type [options]
[ADD COLUMN name1 type1 [options], ADD COLUMN name2 type2 [options], ...
| DROP COLUMN name
| MODIFY COLUMN name type
| MODIFY COLUMN name SET FULLTEXT [WITH <options>]
Expand All @@ -77,6 +77,12 @@ ALTER TABLE monitor ADD COLUMN load_15 double;

列的定义和 [CREATE](./create.md) 中的定义方式一样。

我们可以在表中同时增加多个列:

```sql
ALTER TABLE monitor ADD COLUMN disk_usage double, ADD COLUMN disk_free double;
```

我们可以设置新列的位置。比如放在第一位:

```sql
Expand Down

0 comments on commit 7f8a917

Please sign in to comment.