MySQL Insert Where query

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

    You Should not use where condition in Insert statement. If you want to do, use insert in a update statement and then update a existing record.

    Actually can i know why you need a where clause in Insert statement??

    Maybe based on the reason I might suggest you a better option.

提交回复
热议问题