i have to update total_orders of customers column to be equal to the total number of all the orders placed by the customer(in cust_order)
here is what i have tried
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;
But this is the error i get
ORA-01779: cannot modify a column which maps to a non key-preserved table