I have a table of Vendor invoices that has invoice number,po number and total invoice amount. I need to update another table that keeps a running total of the amount spent on the po from the vendor invoice table.
So I need to add field inv_tot_amount from table vn_inv to the running total field tot_1 in table ap_inv.
This is the statement I tried (along with many variations) and cannot seem to get it to work:
UPDATE ap_inv a SET tot_1= tot_1 + (select inv_tot_amount from vn_inv v (Select v.inv_num, v.po_num from vn_inv v where a.inv_num=v.inv_num AND a.po_num=v.po_num));
The message I get back is:
ERROR at line 1:
ORA-00907: missing right parenthesis
Is there a way to do this?
Thanks,
SBR