MySQL Insert Where query

前端 未结 27 1854
悲&欢浪女
悲&欢浪女 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:49

    You can't use INSERT and WHERE together. You can use UPDATE clause for add value to particular column in particular field like below code;

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

提交回复
热议问题