mysql insert BigDecimal
时间: 2023-10-23 08:48:12 浏览: 124
BigDecimal使用
In MySQL, you can insert a BigDecimal value into a column defined as DECIMAL or NUMERIC using the INSERT statement. Here is an example:
Assuming you have a table named "my_table" with a column named "my_column" defined as DECIMAL(10,2):
INSERT INTO my_table (my_column) VALUES (CAST('12345.67' AS DECIMAL(10,2)));
This statement will insert the BigDecimal value of 12345.67 into the "my_column" column of the "my_table" table. Note that we use the CAST function to convert the BigDecimal value to the DECIMAL data type, which is supported by MySQL.
阅读全文