码迷,mamicode.com
首页 > 数据库 > 详细

数据库

时间:2019-07-15 17:24:44      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:unsigned   删除   字段   rop   odi   名称   指定   arch   prim   

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 字段名;

数据库

标签:unsigned   删除   字段   rop   odi   名称   指定   arch   prim   

原文地址:https://www.cnblogs.com/wangjie001/p/11189983.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!