admin管理员组文章数量:1660218
Data truncation: Out of range value for column ‘estimate_score’
出现这个问题的原因是由于
create table qs_study_user_score_statistics
(
id bigint(20) not null auto_increment comment '主键id',
user_extend_id bigint(20) comment '用户扩展id',
subject_id bigint(20) comment '科目id',
estimate_score decimal(4,2) comment '预估分',
is_valid tinyint(1) not null default 1 comment '逻辑删除0.无效1.有效',
create_by varchar(255) default '' comment '创建人',
create_time datetime comment '创建时间',
update_by varchar(255) default '' comment '更新人',
update_time datetime comment '更新时间',
remark varchar(255) default '' comment '备注',
primary key (id)
);
建表时设置的estimate_score 位数不够,在出现了需要存入的数据 100.5 的时候,整数位置为3位,而数据库设置的decimal(4,2) 4表示总共的数据为长度;2表示小数位2位,那么整体下来整数位只有2位,100超过整数位最大长度而存入异常,根据此处业务需求将总长度改为6位即可
ALTER TABLE qs_study_user_score_statistics MODIFY COLUMN estimate_score decimal(6,2) DEFAULT NULL COMMENT '预估分';
本文标签: truncationDatarangeestimatescoreColumn
版权声明:本文标题:Data truncation: Out of range value for column ‘estimate_score‘ 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dongtai/1729850138a1215299.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论