对于 字段是字符串型,供参考update a
set a.m =
(select b.a || decode(b.a, null, '', ',') || b.b ||
decode(b.b, null, '', ',') || b.c ||
decode(b.c, null, '', ',') || b.d ||
decode(b.d, null, '', ',')
from b
where (case
when b.a is not null then
instr(a.a || a.b || a.c || a.d || a.e, b.a) = 1
end)
and (case
when b.b is not null then
instr(a.a || a.b || a.c || a.d || a.e, b.b) = 1
end)
and (case
when b.c is not null then
instr(a.a || a.b || a.c || a.d || a.e, b.c) = 1
end)
and (case
when b.d is not null then
instr(a.a || a.b || a.c || a.d || a.e, b.d) = 1
end)
set a.m =
(select b.a || decode(b.a, null, '', ',') || b.b ||
decode(b.b, null, '', ',') || b.c ||
decode(b.c, null, '', ',') || b.d ||
decode(b.d, null, '', ',')
from b
where (case
when b.a is not null then
instr(a.a || a.b || a.c || a.d || a.e, b.a) = 1
end)
and (case
when b.b is not null then
instr(a.a || a.b || a.c || a.d || a.e, b.b) = 1
end)
and (case
when b.c is not null then
instr(a.a || a.b || a.c || a.d || a.e, b.c) = 1
end)
and (case
when b.d is not null then
instr(a.a || a.b || a.c || a.d || a.e, b.d) = 1
end)
是用A表中的一行去比较整个B表的内容?还是A表中的一行去比较B表中对应的某一行?
A为主表,B为子表,A中每行,匹配B中每行,知道有匹配,在A中该行记下匹配内容,如 A 中有 1 2 3 4,
B中有2 4,匹配为2 4,A中该行 1 2 3 4 2,4 若B中有1 2 3 则匹配1 2 3 而不匹配 2 4则 A中该行为:
1 2 3 4 1,2,3