确定 postgres 数字最大值最小值 [英] Determine postgres numeric max min values
本文介绍了确定 postgres 数字最大值最小值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的一个 PostgreSQL 表中,有一个数据类型为 Numeric(20,10) 的属性结果.
In one of my PostgreSQL table there is an attribute result with datatype Numeric(20,10).
其中一个输入值可以是 +/- 无穷大.
One of its input value can be +/- infinity.
我想知道长度 (20,10) 的最大值是多少?最小值.
I want to know with the length (20,10) what are the maximum & minimum values.
推荐答案
对于numeric(precision, scale)
的数值,限制值为:
For a numeric of numeric(precision, scale)
, the limit values are:
+- ((10^precision)-1)/(10^scale)
所以对于 numeric(20,10)
就是 ((10^20)-1)/(10^10)
或 9999999999.9999999999
.
so for numeric(20,10)
that'd be ((10^20)-1)/(10^10)
or 9999999999.9999999999
.
这篇关于确定 postgres 数字最大值最小值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文