开发者

SQL error on insert

开发者 https://www.devze.com 2023-02-25 14:06 出处:网络
What is wrong with the following SQL statement?开发者_JAVA百科 INSERT INTO thread (deleted) VALUES (\'2009-01-02 17:41:02\')

What is wrong with the following SQL statement?开发者_JAVA百科

INSERT INTO thread (deleted) 
VALUES ('2009-01-02 17:41:02') 
WHERE thread.id = 28

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 'WHERE thread.id = 28' at line 3

EDIT: I'm such an Idiot... UPDATE!!!

Thank you.


http://dev.mysql.com/doc/refman/5.0/en/update.html

UPDATE thread 
   SET deleted = TIMESTAMP '2009-01-02 17:41:02'
 WHERE id = 28;


You can't put a where in an insert...values... statement. What are you trying to do?

0

精彩评论

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