Skip to content
Advertisement

How to get string after character oracle

I have VP3 - Art & Design and HS5 - Health & Social Care, I need to get string after '-' in Oracle. Can this be achieved using substring?

Advertisement

Answer

For a string operation as simple as this, I might just use the base INSTR() and SUBSTR() functions. In the query below, we take the substring of your column beginning at two positions after the hyphen.

We could also use REGEXP_SUBSTR() here (see Gordon’s answer), but it would be a bit more complex and the performance might not be as good as the above query.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement