views:

59

answers:

2

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 line 3

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

+3  A: 
UPDATE `table_name`
SET `ID` = `ID`
WHERE `ID` = 257
jasonbar
+1  A: 

How about:

UPDATE table_name
SET
    ID = 257
WHERE
    ID = 257

Would that work for you?

Sam