I need to extract string from a value of a cell in Oracle table. How can I do that?
VALUE
--------
/var1/var2/var3/C751994ZP1QT11/var4.itp
I want to extract “C751994ZP1QT11” from the value using SQL. I searched some function like REGEXP_LIKE, but I am not quite understand how to use it.
Thanks ahead for the help.
If you want to extract a string, you need to use
regexp_substr().regexp_like()would return a boolean indicating if a certain regular expression matches your string, whileregexp_substr()actually returns the matched string.In your case, assuming you want the string between
/**and**/, you could use something like this:Refer here for some useful shortcuts on regular expressions with Oracle.