select st.uid*10+1 from student as st;
错误:BIGINT value is out of range in '(`student`.`st`.`uid` * 10)'
原因在于 student.uid * 10 长度过长或者有负数,超过字段类型范围
字段类型为 `uid` bigint(20) NOT NULL DEFAULT '0' COMMENT '学生id',
数据为 ‘8359387873396123111’ ,长度为19,再乘以10后长度范围,
解决方法:利用cast或者convert函数转换后在计算
select cast(st.uid as char)*10+1 from student as st;
select cast(st.uid as DECIMAL(20,0))*10+1 from student as st;
select convert(st.uid ,char)*10+1 from student as st;
select convert(st.uid ,DECIMAL(20,0))*10+1 from student as st;