ADD COLUMNS
命令功能
ADD COLUMNS命令用于为现有表添加新列。
命令语法
ALTER TABLE tableName ADD COLUMNS(col_spec[, col_spec ...])
参数描述
| 参数 | 描述 | 
|---|---|
| tableName | 表名。 | 
| col_spec | 可由[col_name][col_type][nullable][comment][col_position]五部分组成。 
 | 
示例
alter table h0 add columns(ext0 string); alter table h0 add columns(new_col int not null comment 'add new column' after col1); alter table complex_table add columns(col_struct.col_name string comment 'add new column to a struct col' after col_from_col_struct);
系统响应
通过运行DESCRIBE命令,可显示新添加的列。
 
  