ORA-01779:无法修改在更新连接表时映射到非密钥保留表的列

时间:2014-09-11 07:20:11

标签: sql oracle9i

我有这个问题。

update 
(
select pt.poid_id0, umt.plan_id
from norie.plan_t_test pt 
join norie.UAS_MAPPING_TEST umt on (pt.poid_id0 = umt.plan_id)
)
set plan_id = poid_id0
where poid_id0 <> plan_id;

但显示ORA-01779。请帮忙。

1 个答案:

答案 0 :(得分:0)

更新查询总是很棘手。尝试合并。

MERGE INTO uas_mapping_test t1
USING 
(   
  select pt.poid_id0, umt.plan_id
    from norie.plan_t_test pt 
    join norie.UAS_MAPPING_TEST umt on (pt.poid_id0 = umt.plan_id)
) ta ON poid_id0 <> plan_id
WHEN MATCHED THEN UPDATE 
set plan_id = poid_id0