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!

Hi, How to remove symbol '+' from single value (+DEF|IJK|XYZ|MNO) below query in oracle?

User_X872AAug 3 2022

Kindly help on this logic function
result should be "DEF|IJK|XYZ|MNO" in single value
When i trying this way getting "missing right parenthesis"..
select col1,
(substr(col2, 1,1)='+','|'
|| substr(col2, greatest(-LENGTH(col2),-LENGTH(RTRIM(col2))-1))||'|',
(substr(col2,1,1)='-','~|'||substr(col2,greatest(-length(col2),-length(rtrim(col2))-1))||'|','any'))
as col2
from table;

Comments

Post Details

Added on Aug 3 2022
3 comments
161 views