开发者

MySQL Update syntax error

开发者 https://www.devze.com 2022-12-22 10:38 出处:网络
I need to have MySQL query like this one: UPDATE table_name SET 1 = 1 WHERE ID = 257 But I got the syntax error:

I need to have MySQL query like this one:

UPDATE table_name
SET
    1 = 1
WHERE
    ID = 257

But I got the syntax error:

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 '1 = 1 
WHERE ID = 257' at li开发者_StackOverflow社区ne 3

Need to perform an UPDATE query without updating anything. What are the solutions?


UPDATE `table_name`
SET `ID` = `ID`
WHERE `ID` = 257


How about:

UPDATE table_name
SET
    ID = 257
WHERE
    ID = 257

Would that work for you?

0

精彩评论

暂无评论...
验证码 换一张
取 消