mysql 修改字段类型

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 '';

原文地址:https://www.cnblogs.com/zhangzhifeng/p/6157016.html