Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

how to alter the same property multiple times in the same statement #595

Closed
Amber1990Zhang opened this issue Jan 12, 2021 · 1 comment
Closed
Labels
question Type: question about the product

Comments

@Amber1990Zhang
Copy link
Contributor

The doc says:

一个 ALTER 语句允许使用多个 ADD,DROP,CHANGE 语句,语句之间需用逗号隔开。但是不要在一个语句中添加,删除或更改相同的属性。如果必须进行此操作,请将其作为 ALTER 语句的子语句。

But how to add, drop or change the same property in one statement? I want an example

@HarrisChu HarrisChu added the question Type: question about the product label Jun 15, 2021
@HarrisChu
Copy link
Contributor

(root@nebula) [nba]> alter tag player add (test int);
Execution succeeded (time spent 2248/7486 us)

Tue, 15 Jun 2021 11:49:35 CST

(root@nebula) [nba]> alter tag player add (test2 int), drop(test);
Execution succeeded (time spent 1420/6751 us)

Tue, 15 Jun 2021 11:49:48 CST

(root@nebula) [nba]> describe tag player
+---------+----------+-------+---------+
| Field   | Type     | Null  | Default |
+---------+----------+-------+---------+
| "name"  | "string" | "YES" |         |
+---------+----------+-------+---------+
| "age"   | "int64"  | "YES" |         |
+---------+----------+-------+---------+
| "test2" | "int64"  | "YES" |         |
+---------+----------+-------+---------+
Got 3 rows (time spent 1170/6420 us)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Type: question about the product
Projects
None yet
Development

No branches or pull requests

3 participants