Oracle merge的多组匹配条件该怎么写?

Oracle merge的多组匹配条件该怎么写?

比如我是想要这种多组条件:
[code="sql"]
merge into whiskytest x
using (select t.*, t.rowid from whiskytest t) t
on (x.remark = t.remark and x.updater = t.updater) or (x.remark is null and x.updater = t.updater) or (x.remark is null and x.updater is null)
when matched then
update set x.seq=t.seq;
[/code]
当然这样写是错误的,只是想表达on条件那里的多组条件组合要怎么写!!

但是又不等同于这种on写法:
[code="sql"]
merge into whiskytest x
using (select t.*, t.rowid from whiskytest t) t
on ((x.remark = t.remark or x.remark is null) and (x.updater = t.updater or x.updater is null))
when matched then
update set x.seq = t.seq;

[/code]
请指教~~~~~~

1个回答

merge::=
MERGE
hint
INTO
schema .
table
view
t_alias
USING
schema .
table
view
subquery
t_alias
ON ( condition )
merge_update_clause merge_insert_clause error_logging_clause
;

on (x.remark = t.remark and x.updater = t.updater) or (x.remark is null and x.updater = t.updater) or (x.remark is null and x.updater is null)

按语法的话 少了一对外括号

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!