语法
REPLACE ( string_expression , string_pattern , string_replacement )
使用
查询替换
select replace(name, 'Marry', 'Tom') from test_table;
更新替换
update test_table set name=replace(name, 'Marry', 'Tom') where id=123;
插入替换
replace into test_table values(123, 'name', 'Marry', 'Tom');
网友评论