I have a table like this:
In the column "Status" are values like '00', '01', 'OB' In the column "Code" are values like:
I am just interested for rows where "Status" = '00'. The status '00' shows just values like [05]+000569. These values should be trimmed with the following function:
select replace(regexp_substr(Code, '(^|[+])[0-9]+'), '+', '')
How can I build a SELECT SQL with this function just for rows where "Status" = '00' ?
I see. You want a case
expression:
select (case when status = '00' then replace(regexp_substr(Code, '(^|[+])[0-9]+'), '+', '')
end)