小编典典

MYSQL 截断不正确的 DOUBLE 值

all

当执行下面的 SQL 查询时:

UPDATE shop_category 
SET name = 'Secolul XVI - XVIII' 
    AND name_eng = '16th to 18th centuries' 
WHERE category_id = 4768

引发以下错误:

1292 - Truncated incorrect DOUBLE value: 'Secolul XVI - XVIII'

如何解决这个问题?


shop_category表结构:

category_id   mediumint(8)
name        varchar(250)
name_eng      varchar(250)

阅读 28

收藏
2022-08-05

共1个答案

小编典典

您不需要AND关键字。这是UPDATE 语句的正确语法

UPDATE 
    shop_category 
SET 
    name = 'Secolul XVI - XVIII', 
    name_eng = '16th to 18th centuries' 
WHERE 
    category_id = 4768
2022-08-05