【发布时间】:2021-05-04 22:48:58
【问题描述】:
我有 3 个表:inventory 作为表 1,buy_transaction 作为表 2,po_data 作为表 3。
这些是我尝试过的查询:
update vnt_inventory_tab.quantity
set vnt_inventory_tab.quantity = quantity + (SELECT pdt.quantity
FROM vnt_po_data_tab pdt JOIN vnt_buy_trnsctn_tab bt ON pdt.po_no = bt.po_no
WHERE pdt.po_no = :p_po_no)
where VNT_INVENTORY_TAB.CODE = VNT_PO_DATA_TAB.CODE;
它返回表不存在。我不确定我在哪里做错了,因为当我执行子查询时,它会准确返回我想要更新到库存中的数字。
请帮帮我
【问题讨论】:
-
请显示完整的错误信息。
-
[错误] 执行 (1: 76): ORA-00942: 表或视图不存在
-
更新 vnt_inventory_tab.quantity -> 更新 vnt_inventory_tab
-
看起来最终条件
vnt_inventory_tab.code = vnt_po_data_tab.code属于子查询,因为vnt_inventory_tab没有名为vnt_po_data_tab.code的列。
标签: plsql oracle11g plsqldeveloper