CodePudding user response:
Your great god help and have a lookCodePudding user response:
The original data long what kind, what is expected results, use of excel,CodePudding user response:
Write the original value in excel with the final resultsCodePudding user response:
CodePudding user response:
The replace (replace (replace (fields, '01', 'A'), '02', 'B'), '3', 'C')CodePudding user response:
I this value is not constant 01 and 02, is another table data fields such as ID generated by the splicing series, to replace with another table ID such as the NAME fieldCodePudding user response:
with tab1 as (
Select 'by' 01 id from dual
)
Tab2 as (
Select '01' id, 'A' des from dual union all
Select the '02' id, 'B' des from dual
)
, tab3 as (
The select regexp_substr (t1. Id, '[^,] +' 1, level) r_id, level lv, t1. Id from tab1 t1
Connect by t1. Id=the prior t1. Id
And the prior sys_guid () is not null
And level & lt;=regexp_count (t1. Id ', ') + 1
)
Select a t1. Id, listagg (t2) des, ', ') within group (order by t1. Lv) from tab3 t1, tab2 t2
Where a t1. R_id=t2. Id
Group by t1. Id
;
CodePudding user response:
SELECT the biggest, AA. Field FROM AA LEFT JOIN B ON AA. A=B.BCodePudding user response:
The update aa set id=decode (' 01 ', 'A', '02', 'B',... )CodePudding user response:
This should be what you want, through b table name field to update aa table id fieldThe update aa set id=(select bb. Name the from bb where aa. Id=bb. Id)
Where the exists (select 1 from bb where aa. Id=bb. Id)