MySQL Insert Where query

前端 未结 27 2386
悲&欢浪女
悲&欢浪女 2020-11-22 06:16

What\'s wrong with this query:

INSERT INTO Users( weight, desiredWeight ) VALUES ( 160, 145 ) WHERE id = 1;

It works without the WHE

27条回答
  •  野的像风
    2020-11-22 06:44

    its totall wrong. INSERT QUERY does not have a WHERE clause, Only UPDATE QUERY has it. If you want to add data Where id = 1 then your Query will be

    UPDATE Users SET weight=160, desiredWeight= 145 WHERE id = 1;
    

提交回复
热议问题