mysql在表的某一位置增加一列、删除一列、修改列名
1.添加
添加该列到表的最后
alter table t1 add column addr varchar(20) not null;
指定在某一列后添加列
alter table t1 add column addr varchar(20) not null after user1;
将添加的列指定到第一列
alter table t1 add column addr varchar(20) not null first;
2.修改
将表列名:c_old -> c_new
alter table 表名 change c_old c_new char;
修改列的类型或者长度
alter table 表名 modify column 字段名 类型;
alter table address modify column city varchar(50);
3.删除
alter table 表名 drop column 列名 ;

浙公网安备 33010602011771号