storing negative value in mysql

Hafiz picture Hafiz · Dec 27, 2011 · Viewed 62.4k times · Source

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?

Answer

gbn picture gbn · Dec 27, 2011

Use MySQL DECIMAL type?

Standard SQL requires that DECIMAL(5,2) be able to store any value with five digits and two decimals, so values that can be stored in the salary column range from -999.99 to 999.99