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: add multiple columns #1468

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
8 changes: 7 additions & 1 deletion docs/reference/sql/alter.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,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 @@ -73,6 +73,12 @@ ALTER TABLE monitor ADD COLUMN load_15 double;

Definition of column is the same as in [CREATE](./create.md).

Also, we can add multiple columns to the table at the same time:

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

We can set the new column's location. In first position for example:

```sql
Expand Down
Loading