对于 字段是字符串型,供参考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)
解决方案 »
- 语句问题
- 求助呀!!!关于触发器,请故障解决下
- 关于sqlloader log日志问题
- 关于Oracle的一些问题
- 连接数据库出现错误ORA-12541: TNS: 没有监听器,高手指点~急~~~~
- 高手来看看can bind a LONG value only for insert into a LONG column
- oracle大量消耗硬盘空间的问题
- 请看我的PRO*C作品!
- oracle contains 模糊查询数据少了,是因为排除重复的数据了吗
- 调用存储过程报错,ORA-06576: 不是有效的函数或过程名
- 关于四表的查询
- oracle,如何查看视图结构,获得视图中的字段名称、字段类型、字段长度等。
是用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