Mysql特有语法

10. January 2017 DataBase 0

insert into lijian.user(id,name,age) values(2,’lijian’,99) on duplicate key update age=101

若此记录不存在,则插入数据,如果存在,则更新age。


Leave a Reply

Your email address will not be published. Required fields are marked *