不好意思问题还没提:
编译是通过了,但在执行的时候,程序第三行发生错误:
........"A"."dir_unum",invalid identifier.......
我不明白什么意思,这个字段是存在的,请问什么原因?
merge使用时有什么限制吗?
编译是通过了,但在执行的时候,程序第三行发生错误:
........"A"."dir_unum",invalid identifier.......
我不明白什么意思,这个字段是存在的,请问什么原因?
merge使用时有什么限制吗?
是"A"."user_num",在第三行。谢谢提醒,今天比较昏。
“a.user_num 是主键吗?”-----------------你的意思是相比较的这个字段必须是主键吗?
“既然 a.user_num=S.user_num时,是matched,你为什么咳update set呢?“-----------------------这个问题是这样的,我要更新的 是这条记录后面其他的字段,当然这个字段可以不用更新,但应该不影响把?
when matched then
update set “a.user_num=S.user_num”“”这里重复了
标准语句:
merge into table1 a
using(select * from table2 b)
on (a.id=b.id)
when matched then
update set fno='old'
when not matched then
insert into values(a.id,'new');