update A set rmb=replace(rmb,'ABC','RMB'); 替换rmb中ABC的部分为RMB update A set rmb=replace(rmb,'ABC',''); 即相当于删除所有ABC
update tt set rmb=replace(rmb,'ABC','RMB') mysql help: REPLACE(str,from_str,to_str) Returns the string str with all occurrences of the string from_str replaced by the string to_str. REPLACE() performs a case-sensitive match when searching for from_str. mysql> SELECT REPLACE('www.mysql.com', 'w', 'Ww'); -> 'WwWwWw.mysql.com'This function is multi-byte safe
替换rmb中ABC的部分为RMB update A set rmb=replace(rmb,'ABC','');
即相当于删除所有ABC
mysql help:
REPLACE(str,from_str,to_str) Returns the string str with all occurrences of the string from_str replaced by the string to_str. REPLACE() performs a case-sensitive match when searching for from_str. mysql> SELECT REPLACE('www.mysql.com', 'w', 'Ww');
-> 'WwWwWw.mysql.com'This function is multi-byte safe