Oracle数据库学习笔记_Oracle之replace()函数的使用

语法:replace(string,string1,string2)

作用为:使用string2替换掉原字符串string中 包含的所有string1。

例如:

select REPLACE('2020/06/29', '/','-') FROM dual;

----------返回

2020-06-29

当“原字段新内容“省略时,默认为删除原字段就内容
select REPLACE('2020-06-29', '-') FROM dual;

----------返回

20200629

select REPLACE('2020-06-29', '06-')  FROM dual;

----------返回

2020-29

select REPLACE('2020-06-29', '2')  FROM dual;

----------返回

00-06-9

原文地址:https://www.cnblogs.com/tongying/p/13206811.html