0
点赞
收藏
分享

微信扫一扫

mysql向数据库插入小数,变成了整数,解决方案

ivy吖 2022-06-17 阅读 51

mysql向数据库插入小数,变成了整数,

导致这个问题的原因是:

在设计表的时候,得定义表字段小数点的位数;

mysql向数据库插入小数,变成了整数,解决方案_数据库

 示例sql语句:

mysql> create table MyClass(
> id int(4) not null primary key auto_increment,
> name char(20) not null,
> sex int(4) not null default '0',
> degree double(16,2));

double(16,2) 16位长度,小数点后2位。


举报

相关推荐

0 条评论