Skip to content

Commit

Permalink
chore: add multiple columns
Browse files Browse the repository at this point in the history
  • Loading branch information
NiwakaDev committed Jan 12, 2025
1 parent b1becae commit 321cb17
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit 321cb17

Please sign in to comment.