justcode.ikeepstudying.com
Mysql: 数据存在更新,不存在插入, Insert if not exist otherwise update, mysql update or insert if not exists without primary key, replace into - Just Code
一般有三种方法: 我们用名为 books 的表做演示 mysql> SELECT * FROM books LIMIT 3; +----+-------------------------+---------------------+----------------+ | id | title | author | year_published | +----+-------------------------+---------------------+----------------+ | 1 | In Search of Lost Time | Marcel Proust | 1913 | | 2 | Ulysses | James Joyce | 1922 | | 3 | Don Quixote | Miguel de […]
Gideon