1

I've found a lot of questions there and in the other sites about the best data type for storing prices in MySQL and they said Decimal is the best.

But, my price column is a bit difference. All prices are integer (non-decimal) and the maximum amount is 999,999,999 ........

Which data type should I use?

4

1 回答 1

2

假设您的价格始终为正,请使用UNSIGNED INT. 它的范围高达 40 亿(对您来说绰绰有余)并存储整数值而不会丢失精度。

有关的

于 2012-07-26T08:21:23.207 回答