oracle NUMBER(22)和mysql bigint(22)字段类型有关问题

oracle NUMBER(22)和mysql bigint(22)字段类型问题.

这张图片是淘宝API技术支持人员给提供的淘宝数据结构的截图, 这个是他们的订单ID字段的类型. 他们应该是oracle的.

NUMBER类型 长度是22 但是实际上订单id长度目前在14位,  

对应他这个订单ID字段, 我在mysql里面用bigint(22) 类型和长度来做ID的存储 有问题吗?

有经验的童鞋们 帮忙分析一下.



为什么不用Decimal(22,0)来描述呢?不要使用varchar。

DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL] 

For MySQL 5.0.3 and above: 

A packed “exact” fixed-point number. M is the total number of digits and D is the number of decimals. The decimal point and (for negative numbers) the ‘-‘ sign are not counted in M. If D is 0, values have no decimal point or fractional part. The maximum number of digits (M) for DECIMAL is 64. The maximum number of supported decimals (D) is 30. If UNSIGNED is specified, negative values are disallowed. 

If D is omitted, the default is 0. If M is omitted, the default is 10. 

All basic calculations (+, -, *, /) with DECIMAL columns are done with a precision of 64 decimal digits. 




探讨

Decimal的效率是不是跟int类型的差不多呀?

引用:

为什么不用Decimal(22,0)来描述呢?不要使用varchar。

DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL]

For MySQL 5.0.3 and above:

A packed “exact” fixed-point numbe……

oracle NUMBER(22)和mysql bigint(22)字段类型有关问题

相关文章:

你感兴趣的文章:

标签云: