我必须将客户列的总订单更新为等于客户下的所有订单的总数(在 cust_order 中)
这是我尝试过的
update (select *
from atish_customer a
inner join
(
select cust_nbr,count(cust_nbr) as count_orders
from atish_cust_order
group by cust_nbr
)c
on c.cust_nbr=a.cust_nbr)
set tot_orders=count_orders;
但这是我得到的错误
ORA-01779: cannot modify a column which maps to a non key-preserved table