现在的位置: 首页 > 综合 > 正文

mysql更改表字段类型

2013年09月16日 ⁄ 综合 ⁄ 共 232字 ⁄ 字号 评论关闭

1.更改Float字段类型to Decimal

ALTER TABLE 表名 MODIFY 字段名 decimal(10,2) not null default '0';
如:
ALTER TABLE invoice MODIFY TotalMoney decimal(10,2) not null  default '0';

2.添加字段

alter table 表名 add 字段名 字段类型 not null ;
如:
alter table teacher add TypeMark varchar(50) null default '';

抱歉!评论已关闭.