MySQL Insert Where query

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

    I think your best option is use REPLACE instead INSERT

    REPLACE INTO Users(id, weight, desiredWeight) VALUES(1, 160, 145);

提交回复
热议问题