語法結構如下:
alter table tablename add (column datatype [default value][null/not null],….);
alter table tablename modify (column datatype [default value][null/not null],….);
alter table tablename drop (column);
例子:
增加列
alter table t_jm_user add USR_EmailValidate CHAR(1) default 'N' not null;
修改列
alter table t_jm_user modify USR_EmailValidate CHAR(1) default 'Y' null;
刪除列
alter table t_jm_user drop column USR_EmailValidate;
增加約束
alter table user
add constraint FK_user_CLIENT foreign key (COMP_ID)
references T_stal (COMP_ID);
刪除約束
alter table user drop constraint FK_user_CLIENT ;