alter table{table_name}
{[ add | drop column | modify | rename column old_column to new_column ]}
--添加字段
alter table {table_name} add {column_name datatype} [default] [constraint]
--删除字段
alter table {table_name} drop column {column_name}
--修改字段,默认值,约束
alter table {table_name} modify column_name [datatype] [default] [constraint]
--修改字段名
alter table {table_name} rename column {old_name} to {new_name}
例如
alter table gzl02_temp rename column id to "gzl02id";
--删除唯一性约束
alter table {table_name} drop unique(column_name)
--添加主键
alter table {table_name} add primary key (column_name)
--添加外键,自定义约束名FK_1
alter table {table1} add constraint FK_1 foreign key (table1_column1)
references table2(table2_column1)