0

我有以下简单的更新

    UPDATE INVOICE
    SET INV_SUBTOTAL = V_SUBTOTAL
    WHERE INV_ID = I_INV_ID;

我如何声明i_inv_idlike 将其添加为别名,因为我将它与另一个名为 bookings 的表相关联。就像是;

UPDATE INVOICE
        SET INV_SUBTOTAL = V_SUBTOTAL
        WHERE INVOICE.INV_ID = BOOKINGS.INV_ID;
4

1 回答 1

0

我认为你可以使用这样的构造:

UPDATE INVOICE SET INV_SUBTOTAL = V_SUBTOTAL WHERE INVOICE.INV_ID IN (SELECT B.INV_ID FROM BOOKINGS V WHERE ....);

于 2012-11-20T04:43:43.880 回答