我从 WAMP 服务器得到的小数是小数 (5,2) 我的查询异常:
SQLSTATE[22003]:数值超出范围:1264 第 1 行“converted_1000ml”列的值超出范围(SQL:插入 inventory_databanks
(product_desc
, nc_os
, ncos_value
, del
, ei
, sa
, wh
, bi
, brand
, variant
, type
, content
, conversion_1000ml
,**converted_1000ml**
,os
,bo
,peso_sales
,bo_case
, os_case
, del_case
, wh_case
, sa_case
, price
>, facing
, maker
, merchandiser_name
, complete_address
, source_type
, payroll_period
, cellphone
, schedule
, area
, region
, 省
, city_municipality
, outlet
, edi_branch
, 销售员
, ns_case1
, ns_case2
, ns_case3
, ns_bottles1
, ns_bottles2
, ns_bottles3
, ns_date1
, ns_date2
, ns_date3
, date_started
code>, inventory_date
, updated_at
, created_at
) 值 (Emperador_Light 1000mL Light Brandy, With Stocks, With Stocks, 2400, 4734, 78, 4656, 245, Emperador_Light, 白兰地, 原味, 1000, 1.00, 4734.00, 0, 0, -229790, 0, 0, 0, 0, 0, 110.00, 13, EDI, Rodolfo Siongco Jr, null, 来自库存表, 01/16/2018 - 01/31/2018, 09303243249, T-TH-S, Central Luzon, Region III, Bataan, Mariveles, CORA'S, Pampanga Branch, Angelito Quetua, 0, 0, 0, 0, 0, 0, 2018-01-31, 2018-01-31, 2018-01-31, 2018-01-16, 1970-01-01, 2018-02-08 08:49 :48, 2018-02-08 08:49:48))
我该如何解决这个问题?粗体数字我认为这是我的问题
最佳答案
小数 (5,2) 的范围是 -999.99 到 999.99。您将不得不更改该列以保存较大的值。
salary DECIMAL(5,2)
In this example, 5 is the precision and 2 is the scale. The precision represents the number of significant digits that are stored for values, and the scale represents the number of digits that can be stored following the decimal point.
Standard SQL requires that DECIMAL(5,2) be able to store any value with five digits and two decimals, so values that can be stored in the salary column range from -999.99 to 999.99.
关于mysql - SQLSTATE[22003] : Numeric value out of range: 1264 Out of range value,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48681491/