[Solved] MYSQL Error: BIGINT UNSIGNED value is out of range

Causes:

When two fields are trying to be subtracted, if one or both fields are of type unsigned, an error is reported if the value to be subtracted is less than 0 (BIGINT UNSIGNED value is out of range)

.
Handling:

Example: select a – b from table

Change:select if(a >= b, a – b, – (b – a)) from table

 

Similar Posts: