如果没法直接修改,可以用命令来完成.有两种途径解决:1、可先加个字段,然后删掉不要的字段,就相当于更改字段名. alter table 表名 add 新字段名 类型; alter table 表名 drop 旧字段名 字段名描述;2、新建个表指定新字段名,然后删除旧表,将新表改名 create table 新表名(新字段列表) as select 字段列表 from 旧表名; drop table 旧表名; alter table 新表名 rename to 旧表名;
Renaming a Column: Example The following example renames the credit_limit column of the sample table oe.customers to credit_amount:ALTER TABLE customers RENAME COLUMN credit_limit TO credit_amount;
其实就是create as select
我不会用pb阿,再说这多麻烦。
alter table 表名 add 新字段名 类型;
alter table 表名 drop 旧字段名 字段名描述;2、新建个表指定新字段名,然后删除旧表,将新表改名
create table 新表名(新字段列表) as select 字段列表 from 旧表名;
drop table 旧表名;
alter table 新表名 rename to 旧表名;
The following example renames the credit_limit column of the sample table oe.customers to credit_amount:ALTER TABLE customers
RENAME COLUMN credit_limit TO credit_amount;
beckhambobo(beckham)谢谢你, 可是我还是比较喜欢用ide方法