czwangzheng

1添加表字段

alter table table1 add transactor varchar(10) not Null;

alter table   table1 add id int unsigned not Null auto_increment primary key

2.修改某个表的字段类型及指定为空或非空
alter table 表名称 change 字段名称 字段名称 字段类型 [是否允许非空];
alter table 表名称 modify 字段名称 字段类型 [是否允许非空];

alter table 表名称 modify 字段名称 字段类型 [是否允许非空];

3.修改某个表的字段名称及指定为空或非空
alter table 表名称 change 字段原名称 字段新名称 字段类型 [是否允许非空

4如果要删除某一字段,可用命令:ALTER TABLE mytable DROP 字段名;

分类:

技术点:

相关文章:

  • 2021-11-30
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
  • 2021-11-20
  • 2022-02-05
猜你喜欢
  • 2021-11-18
  • 2021-11-30
  • 2021-11-20
  • 2021-11-20
相关资源
相似解决方案