美文网首页
SQL replace的用法

SQL replace的用法

作者: 肥牛毛肚番茄锅 | 来源:发表于2020-03-13 18:02 被阅读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');

相关文章

网友评论

      本文标题:SQL replace的用法

      本文链接:https://www.haomeiwen.com/subject/ridsshtx.html