How to add a where clause in a MySQL Insert statement?

前端 未结 8 979
刺人心
刺人心 2020-11-30 12:56

This doesn\'t work:

INSERT INTO users (username, password) VALUES (\"Jack\",\"123\") WHERE id=\'1\';

Any ideas how to narrow insertion to a

8条回答
  •  春和景丽
    2020-11-30 13:34

    UPDATE users SET username='&username', password='&password' where id='&id'
    

    This query will ask you to enter the username,password and id dynamically

提交回复
热议问题