Fixed Precision
Name |
Description |
Storage Space |
Value Range |
Literal |
---|---|---|---|---|
DECIMAL |
Decimal number with fixed precision. The precision can be as high as 38 bits, but for optimal performance, a precision of less than 18 bits is recommended. Decimal has two input parameters:
|
64 bits |
|
DECIMAL |
NUMERIC |
Same as DECIMAL |
128 characters |
|
NUMERIC |
Literal |
Data Type |
---|---|
DECIMAL '0' |
DECIMAL(1) |
DECIMAL '12345' |
DECIMAL(5) |
DECIMAL '0000012345.1234500000' |
DECIMAL(20, 10) |
--Create a table containing DECIMAL data. CREATE TABLE decimal_t1 (dec_col1 DECIMAL(10,3)) ; – Insert data of the DECIMAL type. insert into decimal_t1 values (DECIMAL '5.325'); --View data. SELECT * FROM decimal_t1; dec_col1 --------- 5.325 (1 row) --Drop a table. DROP TABLE decimal_t1; --Create a NUMERIC type table. CREATE TABLE tb_numberic_hetu(col1 NUMERIC(9,7)); --Insert data. INSERT INTO tb_numberic_hetu values(9.12); --View data. SELECT * FROM tb_numberic_hetu; col1 ------------ 9.1200000 (1 row)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot