king

oracle怎样删除列

king Oracle 2022-06-30 772浏览 0

oracle怎样删除列

oracle中删除一个列的方法:

ALTER TABLE 表名 DROP COLUMN 列名

删除多列:(很奇怪不需要 column,切字段名都为简单字段名):

alter table 表名  drop (字段1,字段2)

拓展:

增加列

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 ;


转载请注明:IT运维空间 » Oracle » oracle怎样删除列

继续浏览有关 oracle 的文章
发表评论