Oracle SUBSTR After Character

To access data after a specific character, you can use the SUBSTR function in Oracle. This function is used to extract a portion of a string and allows you to specify the starting position and the number of characters to extract.

Here is an example: Suppose we have a string “Hello World” and we want to retrieve all characters starting from “o”.

SELECT SUBSTR('Hello World', INSTR('Hello World', 'o')) AS result
FROM dual;

In the example above, the INSTR function is used to locate the position of the character “o” in the string, and then the SUBSTR function extracts a substring starting from that position. The output will be “o World”.

You can also specify the number of characters to extract by specifying the third parameter, for example:

SELECT SUBSTR('Hello World', INSTR('Hello World', 'o'), 5) AS result
FROM dual;

Five characters will be extracted after “o”, and the output will be “o Wor”.

bannerAds