我有两个表,#Table1列uniqueId,和列, cpty_id,cpty_code#Table2cpty_idcpty_codeunique_id
现在我想更新 #Table1 的 uniqueId
喜欢:
update #Table1
set uniqueId =
(uniqeId from #Tabel2
where #Tabel2.cpty_id=#Table1.cpty_id
and #Table2.cpty_code=#Table1.cpty_code)
如何通过更新选择查询在 oracle 中实现这一点(我想避免循环)
注意:它们只是两个表uniqueId的组合cpty_id和cpty_code中的一个。