How to delete words using regexp_replace in oracle?

Member

by ryleigh , in category: MySQL , 7 months ago

How to delete words using regexp_replace in oracle?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by dalton_moen , 7 months ago

@ryleigh 

To delete words using REGEXP_REPLACE in Oracle, you can use the following syntax:

1
2
SELECT REGEXP_REPLACE('Your input string', 'Word to delete', '') as output
FROM dual;


For example, if you want to delete the word "example" from the input string, you can use the following query:

1
2
SELECT REGEXP_REPLACE('This is an example sentence', 'example', '') as output
FROM dual;


This will delete the word "example" from the input string and return the output as "This is an sentence".

Related Threads:

How to delete data from one table using joins in oracle?
How to extract text between two words in oracle?
How to store non english words in oracle database?
How to get specific words in an output of oracle query?
How to make a continuous delete statement in oracle?
How to extract all words from a string column in sql oracle?