1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > mysql更改表字段类型

mysql更改表字段类型

时间:2021-08-19 08:41:38

相关推荐

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

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。