replace()函数的入门使用
Oracle中replace()函数的入门使用
- 1、语法
REPLACE(char, search_string, replacement_string )
参数解释:
char : 等待替换的字符串
search_string : 搜索需要替换的字符串
replacement_string : 替换字符串
一般情况下,更新sql语句:
update demo set name = 'XX' where name = 'YY';

需求: 需要把name里面的“医院”改成“医2院”
就会用到replace()函数
update demo set name = replace(name,'医院','医2院') where name like '%医院%';
update demo set name = replace(name,'医院','医2院')
本文来自博客园,作者:King-DA,转载请注明原文链接:https://www.cnblogs.com/qingmuchuanqi48/articles/15073333.html

浙公网安备 33010602011771号