首页 > 数据库技术 > 详细

Mysql Query error: BIGINT UNSIGNED value is out of range in..解决方法

时间:2017-07-26 17:19:08      阅读:219      评论:0      收藏:0      [点我收藏+]

当字段类型为 unsigned 时,使用相关结果为负值时就会报错,报错如下:

BIGINT UNSIGNED value is out of range in ..


解决方法


使用 cast() 修改字段类型为 signed

select cast(quantity as signed) - cast(frozen_quantity as signed) from ...


本文出自 “技术蓝” 博客,请务必保留此出处http://bstdn.blog.51cto.com/8667020/1951064

Mysql Query error: BIGINT UNSIGNED value is out of range in..解决方法

原文:http://bstdn.blog.51cto.com/8667020/1951064

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!