我的查询有问题:
UPDATE
`MY_COLOR`
SET
`Color` = REPLACE(`Color`, ' ', '')
WHERE
`Color` LIKE ('L %')
相同的查询没有" WHERE Color
LIKE(' L%')"工作
错误:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM `MY_COLOR` WHERE `Color` LIKE ( 'L %' )' at line 3
答案 0 :(得分:0)
LIKE
子句中存在语法错误。
使用
SELECT * FROM TABLE WHERE field1 like '%abc%';
所以在你的情况下,它将是
UPDATE MY_COLOR SET Color = REPLACE(Color, ' ', '') WHERE Color LIKE 'L %';