您的位置:首页 > 数据库 > Oracle

Oracle number数据类型介绍

2017-06-12 22:45 357 查看
number类型存储值的范围为1.0 x 10-130 到 1.0 x 10126(不含)。

每个number占用1-22bytes的存储空间。

NUMBER(p,s)

p is the precision, 最大有效的十进制位数,Oracle guarantees the portability of numbers with precision of up to 20 base-100 digits,

 which is equivalent to 39 or 40 decimal digits depending on the position of the decimal point.

 

s is the scale,指定小数点右边的位数,The scale can range from -84 to 127.如果是负值,比如是-2,相当于round到百分位。

如果s>p,p指的是小数点右边的有效位数,s指的是小数点右边的所有位数。

NUMBER(p)等同于NUMBER(p,0)。

NUMBER,什么都不指定,所有的取值范围。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  oracle sql number