How to replace multiple different strings with Oracle?

You can use the REGEXP_REPLACE function to replace multiple different strings. Here is an example code:

SELECT REGEXP_REPLACE('apple,banana,orange', '(apple|banana|orange)', 'fruit') AS replaced_string
FROM dual;

In the example above, we used the REGEXP_REPLACE function to replace the three different strings “apple,” “banana,” and “orange” in the string with “fruit.” You can also replace multiple different strings according to your own needs by using the vertical bar “|” to separate different strings in the regular expression.

bannerAds