Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Remove few characters from the end and return the remaining through regexp_substr

user8195117Jan 25 2022

Hi All,
I have a hierarchical query that returns the path as /AAA/BBB/CCC where the level of the node CCC is 3.
Would like to get the o/p as '/AAA/BBB' as the parent path for node CCC using regexp_subtr. Please help!
This can be achieved through substr as follows.. but looking for regexp_substr solution
SELECT SUBSTR ('AAA/BBB/CCC', 1, LENGTH ('AAA/BBB/CCC') - 4) FROM DUAL;

This post has been answered by mathguy on Jan 25 2022
Jump to Answer
Comments
Post Details
Added on Jan 25 2022
5 comments
721 views