Mysql replacement function SQL statement: SQL code update userinfo set remark = replace (remark, '1', '9'), reserved1 = replace (reserved1, '4 ', '9') Explanation: This SQL means to replace 1 with 9 in the remark field in the userinfo table, replace 4 in reserved1 with 9 [mysql] replace (replace part of a field. replace into SQL code replace into table (id, name) values ('1', 'A'), ('2', 'bb ') this statement inserts two records into the table. If the primary key id is 1 or 2, it is equivalent to insert into table (id, name) values ('1', 'A'), ('2', 'bb ') if the same value exists, data is not inserted. replace (object, search, replace) replaces all search objects with replace SQL code select replace ('www .163.com ', 'w', 'ww'). For example: replace aa in the name field of the table with bb update table set name = replace (name, 'AA', 'bb') 3. UPDATE updates some of the content in a field. Now there is a record field named "abcdefg". Now I just want to change c in this field to C, how should I write the SQL code for the update statement? update table name set field 1 = replace (Field 1, 'C', 'C ') ========================================================== ============== another method: RPAD (field, length, target character) SQL code select RPAD (msisdn, 16, 'F') msisdn, RPAD (partition num, 16, 'F') interval num, RPAD (forwardnum, 16, 'F') forwardnum, username from h_numdata raw data: 8613600290008 6101 18600290008 sunnan result: 8613600290008FFF 6101 FFFFFFFFFFFF 18600290008 FFFFF sunnan