Oracle NUMBER的小数位数如何比精度大? [英] How can an Oracle NUMBER have a Scale larger than the Precision?

查看:468
本文介绍了Oracle NUMBER的小数位数如何比精度大?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文档指出:精度范围可以从1到38.比例范围可以从-84到127".

The documentation states: "Precision can range from 1 to 38. Scale can range from -84 to 127".

比例尺如何大于精度?比例尺不应该在-38到38之间吗?

How can the scale be larger than the precision? Shouldn't the Scale range from -38 to 38?

推荐答案

问题可能是为什么? 尝试以下SQL.

The question could be why not ? Try the following SQL.

select cast(0.0001 as number(2,5)) num, 
       to_char(cast(0.0001 as number(2,5))) cnum,
       dump(cast(0.0001 as number(2,5))) dmp
  from dual

您看到的是可以容纳少量数字就是这种结构 可能并不经常需要它,但是我敢肯定,某个地方存储着非常精确但很小的数字.

What you see is that you can hold small numbers is that sort of structure It might not be required very often, but I'm sure somewhere there is someone who is storing very precise but very small numbers.

这篇关于Oracle NUMBER的小数位数如何比精度大?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆