2012-11-20 89 views
0

我有以下簡單的更新甲骨文:update語句

UPDATE INVOICE 
    SET INV_SUBTOTAL = V_SUBTOTAL 
    WHERE INV_ID = I_INV_ID; 

我怎樣才能申報i_inv_id喜歡,因爲我與它到另一個表稱爲訂單增加它的別名。就像是;

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

回答

0

我認爲你可以使用結構是這樣的:

UPDATE發票 SET INV_SUBTOTAL = V_SUBTOTAL WHERE INVOICE.INV_ID IN(SELECT B.INV_ID從BOOKINGS V式....);