Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: the ZH doc of adding multiple columns #1470

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading