A Brief Introduction to MySQL replace, mysqlreplace
Today, when I upgraded discuz, I encountered a primary key repeat, which caused the data insertion to fail. Then I searched for the problem. The method described here was to replace into and then query replace, the following is a brief introduction.
1. replace
Replace into is similar to insert. The difference is that replace into first tries to insert data into the table. if this row of data already exists in the table (determined based on the primary key or unique index), delete the row of data and insert new data. 2. Otherwise, insert new data directly.
2. replace (object, search, replace)
String replacement, for example:
Update table set name = replace (name, 'AA', 'bb ')
Replace aa in the name field of the table with bb and save it to the database.
Use of the Mysql replace () function
Yes.
Updat table set 'zd1 '= REPLACE ('zd1', '#', 'logistic ') WHERE 'zd1' LIKE '% # %'
Mysql replace Problems
I suggest you look at the replace into statement to implement your function!