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;