mysql报错:BIGINT UNSIGNED value is out of range

造成原因:

当两个字段想减时,如果其中一个或两个字段的类型的unsigned无签名类型,如果想减的值小于0则会报错(BIGINT UNSIGNED value is out of range)

处理办法:

例:select a - b from table

改:select if(a >= b, a - b, - (b - a)) from table

原文地址:https://www.cnblogs.com/lixingbaophp/p/10002814.html