一、修改字段默认值

alter table 表名 drop constraint 约束名字   ------说明:删除表的字段的原有约束

alter table 表名 add constraint 约束名字 DEFAULT 默认值 for 字段名称 -------说明:添加一个表的字段的约束并指定默认值

二、修改字段名:

alter table 表名 rename column A to B

三、修改字段类型:

alter table 表名 alter column UnitPrice decimal(18, 4) not null 

alter table 表名  modify  字段名  char(32)  约束  COMMENT 备注
alter table remit_domestic_sub_record  modify account_no  char(32)  null default null COMMENT '账户编号'

三、修改增加字段:

alter table 表名 ADD 字段 类型 NOT NULL Default 0

一、修改字段默认值

alter table 表名 drop constraint 约束名字   ------说明:删除表的字段的原有约束

alter table 表名 add constraint 约束名字 DEFAULT 默认值 for 字段名称 -------说明:添加一个表的字段的约束并指定默认值

二、修改字段名:

alter table 表名 rename column A to B

三、修改字段类型:

alter table 表名 alter column UnitPrice decimal(18, 4) not null 

alter table 表名  modify  字段名  char(32)  约束  COMMENT 备注
alter table remit_domestic_sub_record  modify account_no  char(32)  null default null COMMENT '账户编号'

三、修改增加字段:

alter table 表名 ADD 字段 类型 NOT NULL Default 0

相关文章:

  • 2021-10-14
  • 2022-01-01
  • 2021-12-08
  • 2021-11-18
  • 2021-04-03
  • 2021-11-27
  • 2021-06-05
  • 2021-03-29
猜你喜欢
  • 2021-11-29
  • 2021-07-08
  • 2021-10-23
  • 2021-11-04
  • 2021-06-14
  • 2021-12-06
  • 2021-09-24
  • 2021-12-06
相关资源
相似解决方案