时间:2021-07-01 10:21:17 帮助过:18人阅读
alter table `user` (old) rename to `user1` (new);
alter table `user` comment ‘注释内容‘;
alter table `user` modify column `name` varchar(20) COMMENT ‘应用的名称‘;
alter table `user` modify column `name` text;
alter table `user` modify column `name` varchar(255) null COMMENT ‘描述‘;
alter table `user` add column `name` text not null comment ‘描述‘ after `id`;
alter table `user` add `id` int(5) not null ,add primary key (`id`);
alter table `user` modify column `id` int(5) auto_increment ;
alter table `user` change name `name` varchar(20) not null;
alter table `t_app` drop `name`;
alter table `user` add column `name` int not null default 0 after `id`; #(在哪个字段后面添加)
alter table `user` change `id` `id` int not null after `name` ; #(注意gateway_id出现了2次)
alter table user add index (cn,id);
alter table user drop index cn
alter table user add id int(11) not null;
alter table user change id id1 varchar(10) not null;
insert into user (id, name, state) values(2, ‘小明‘, ‘0‘);
update user set name = ‘xiaoming‘ where id = 2;
delete from user where id = 1;
select * from user;
mysql 语句
标签:rop values rem hang int sql 修改 into 一个