Home  >  Article  >  Database  >  How to use oracle replace() function

How to use oracle replace() function

青灯夜游
青灯夜游Original
2022-03-01 19:25:1840883browse

In Oracle, the replace() function is used to replace a string. It can find the specified character in the specified string and replace it with the new character; syntax "REPLACE('string','search value' ,'replacement value');".

How to use oracle replace() function

The operating environment of this tutorial: Windows 7 system, Oracle 11g version, Dell G3 computer.

In Oracle, the replace() function is used to replace strings.

Thereplace() function finds the specified character in the specified string and replaces it with the new character.

Syntax:

SELECT REPLACE(X,old,new)

Find the old character in the string X and replace it with the new character

Note: REPLACE() is case-sensitive when searching for old match.

Example:

SQL> SELECT REPLACE('www.php.cn', 'w', 'Ww');
+---------------------------------------------------------+
| REPLACE('www.php.cn', 'w', 'Ww')                        |
+---------------------------------------------------------+
| WwWwWw.php.cn                                           |
+---------------------------------------------------------+
1 row in set (0.00 sec)

Recommended tutorial: "Oracle Tutorial"

The above is the detailed content of How to use oracle replace() function. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn