Emanuel Emanuel - 1 month ago 12
MySQL Question

Mysql Truncated incorrect DOUBLE value

When I execute this SQL query:

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


I receive the following error:

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


'shop_category' table structure:

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


How can I fix this?

Thanks.

Answer

You don't need the AND keyword. Here's the correct syntax of the UPDATE statement:

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