I have 3 columns a,b,c. A = 3 B =4, I’m trying to perform an update statement that can handle negative. For example in this case i should get -1, but instead I get the error Out of range value for column ‘C’ at row 1. All columns are ints.
Any suggestions would be awesome!
update tbl
set c = a - b
where uniqueID = 49
Check column
Cdefinition, it might be set asUNSIGNED.EDIT
Check definition of all columns involved in the calculation. If any of them is marked as
UNSIGNED, then all calculations will be done usignUNSGINEDarithmetic with can result in theOut of range valueerror.