Mysql Update BIGINT UNSIGNED value is out of range

Mysql :

update oneTab set num = num - #{count,jdbcType=INTEGER}  where id = 1

 num是int类型,但如果num=0时,则会报出相应 BIGINT UNSIGNED value is out of range in (xx.num字段)

解决方法:

update oneTab set num = CAST(num  AS SIGNED) - #{count,jdbcType=INTEGER}

提示:

(0 row(s) affected, 1 warning(s))

猜你喜欢

转载自blog.csdn.net/zuozhiyoulaisam/article/details/83111107