Reputation: 4267
How can I store negative value in mysql decimal? I have data from DMS to Decimal having negative values, so it is decimal and negative. So what can I use to store such value?
Upvotes: 33
Views: 92319
Reputation: 1166
In case you want to store a negative integer - (INT) will work nicely, unless it's not UNSIGNED.
https://dev.mysql.com/doc/refman/8.0/en/integer-types.html
In case you want to store a negative decimal - (DECIMAL) is the way to go, as GBN mentioned above.
https://dev.mysql.com/doc/refman/5.7/en/precision-math-decimal-characteristics.html
Upvotes: 3