Sometimes we need to replace the mysql string so that we can directly implement it through SQL statements. However, this method is not recommended for fields with large data volumes.
Sometimes we need to replace the mysql string so that we can directly implement it through SQL statements. However, this method is not recommended for fields with large data volumes.
Replace the character 10005 in the field userid in the ubk_vhost_list table with 10010
UPDATE 'table _ name' SET 'field _ name' = replace ('field _ name', 'From _ str', 'to _ str ') WHERE 'field _ name' LIKE '% from_str %'
Note:
Table_name -- table name
Field_name -- field name
From_str -- string to be replaced
To_str -- string to be replaced
A query is run today.
UPDATE ubk_vhost_list SET userid = replace (userid, '20160901', '20160901 ')
For more detailed mysql string replacement statements, refer to the following article.