SQL replace的用法
2020-03-13 本文已影响0人
肥牛毛肚番茄锅
语法
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');