Oracle 从临时表更新到原始表
我有两个表,一个是原始表,另一个是临时表。具有正确记录的临时表。唯一列是cust_id。我的表结构是 客户表Oracle 从临时表更新到原始表,oracle,Oracle,我有两个表,一个是原始表,另一个是临时表。具有正确记录的临时表。唯一列是cust_id。我的表结构是 客户表 cust_id amount 12 100 13 120 14 130 15 250 20 70 25 110 28 900 temp table cust_id amount 12 300 13 190 14 110 15 240 20
cust_id amount
12 100
13 120
14 130
15 250
20 70
25 110
28 900
temp table
cust_id amount
12 300
13 190
14 110
15 240
20 30
25 210
28 500
我想使用客户id将记录从临时表更新到客户原始表。可以使用语句完成
merge into original_table ot
using temp_table tp
on (ot.cust_id = tp.cust_id)
when matched
then update set ot.amount = tp. amount
有什么问题吗?我不知道请告诉我你没有尝试过