I am working with Oracle SQL and I have a column with specific words that I want to extract. For example, I have:
MENACE DE MORT REITEREE EN RECIDIVE
VIOLENCES SUR CONJOINT
And I want to extract:
MENACE MORT
VIOLENCES CONJOINT
I've tried using regex_replace to replace specific words found in my list of words, but I have not been able to extract only the specific words.
Is there a way to do this? I have about 50 specific words to extract.
Thank you in advance for your help!
In any case you will need a list of words (and probably some order of the wrords) to do the job. One of the options is to create a list of words and store them in a table. In this answer I will create CTE (words) as a sample. But first some sample data to work with:
... and words list ...
You can now join your table with the words and truncate your text to the list of words from above...
Result should be ...