MYSQL基本命令(二)

来源:互联网 发布:淘宝商城童装女童鞋子 编辑:程序博客网 时间:2024/05/16 15:14
  1. delete from user where id>10;  删除id>10的记录
  2. alter table user anto_increment=10;  设置user表的自增字段起始值为10
  3. 表字段自我复制:insert into user select * from user;
*如果表有自增字段,自增字段是不能复制的,代码改为:insert into user(name,pass) select name,pass from user;
     4. update user set name='admin' where name is null; 更新表字段
     5. 添加表字段:alter table user add pid int(11);
     6. 删除表字段:alter table user drop pid;


原创粉丝点击