Data truncation: Out of range value for column ‘estimate_score‘

简介: Data truncation: Out of range value for column ‘estimate_score‘


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 '预估分';


相关文章
|
8月前
|
Linux Windows
【已解决】ValueError: num_samples should be a positive integer value, but got num_samples=0
【已解决】ValueError: num_samples should be a positive integer value, but got num_samples=0
|
8月前
|
索引 Python
row[i] = col[j] = TrueIndexError: list assignment index out of range
row[i] = col[j] = TrueIndexError: list assignment index out of range
|
JSON 数据格式
ValueError: With n_samples=0, test_size=0.15 and train_size=None, the resulting train set will be em
ValueError: With n_samples=0, test_size=0.15 and train_size=None, the resulting train set will be em
550 0
ValueError: With n_samples=0, test_size=0.15 and train_size=None, the resulting train set will be em
range
range() 是一个函数,可以用来生成一个自然数的序列。 该函数需要三个参数:起始位置(可以省略,默认是 0);结束位置;步长(可以省略,默认是 1)。 通过 range() 可以创建一个执行指定次数的 for 循环。
122 0
range
|
存储
range_hashed
range_hashed
104 0
|
索引 Python
成功解决ValueError: column index (256) not an int in range(256)
成功解决ValueError: column index (256) not an int in range(256)
成功解决ValueError: column index (256) not an int in range(256)
成功解决ValueError: With n_samples=0, test_size=0.3 and train_size=None, the resulting train set will be
成功解决ValueError: With n_samples=0, test_size=0.3 and train_size=None, the resulting train set will be
成功解决ValueError: With n_samples=0, test_size=0.3 and train_size=None, the resulting train set will be
|
Linux Python
ValueError: empty range for randrange() (0, 0, 0)
ValueError: empty range for randrange() (0, 0, 0)
|
存储 索引
成功解决ValueError: If using all scalar values, you must pass an index
成功解决ValueError: If using all scalar values, you must pass an index
|
索引 Python
成功解决ValueError: Shape of passed values is (33, 1), indices imply (33, 2)
成功解决ValueError: Shape of passed values is (33, 1), indices imply (33, 2)