In one of my PostgreSQL table there is an attribute result with datatype Numeric(20,10).
One of its input value can be +/- infinity.
I want to know with the length (20,10) what are the maximum & minimum values.
PostgreSQL MIN () function an aggregate function that returns the minimum value in a set of values. To find the minimum value in a column of a table, you pass the name of the column to the MIN () function. The data type of the column can be number, string, or any comparable type. SELECT MIN (expression) FROM table_expression ...;
The PostgreSQL MIN function is one of them which is used to return the minimum value from the set of record values. We can use the PostgreSQL MIN function for finding the minimum value for the specific column within the table.
PostgreSQL max function will take value from a single as well as multiple columns to form valid mathematical expression from this expression max function will return the maximum values from the column.
In order to allow numeric values to be sorted and used in tree-based indexes, PostgreSQL treats NaN values as equal, and greater than all non- NaN values. The types decimal and numeric are equivalent. Both types are part of the SQL standard. 8.1.3.
For a numeric of numeric(precision, scale)
, the limit values are:
+- ((10^precision)-1)/(10^scale)
so for numeric(20,10)
that'd be ((10^20)-1)/(10^10)
or 9999999999.9999999999
.
Details in the manual.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With