- 增加列
alter table account add c1 int(11) not null default 1; //非空,默认1
- 删除列
alter table account drop c1;
- 修改列名( city->newcity )
alter table account change city newcity varchar(255);
- 修改数据类型( varchar(255)->text )
alter table account change city city text;
- 修改列名和数据类型( city->newcity、varchar(255)->text )
alter table account change city newcity text;
- 修改表名
alter table account rename newaccount;
SQL操作数据表
最新推荐文章于 2024-05-03 03:30:20 发布