语法结构如下:

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 ;

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-31
  • 2022-12-23
  • 2022-03-06
  • 2022-12-23
  • 2022-01-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2021-07-30
  • 2021-11-28
相关资源
相似解决方案