- 此问题在此处已有答案**:
Update statement with inner join on Oracle(15个答案)
How can I do an UPDATE statement with JOIN in Appex [duplicate](2个答案)
51分钟前关闭。
I want to calculate the sum of value + service fees from a table booking and bill
and the table of bill
CREATE TABLE BILL (BILL_NUM ,SERVICE_FEES,TOTAL_AMOUNT
BILL_DATE ,BOOKING_NUM number REFERENCES BOOKING(BOOKING_NUM)
)
我的预订表包含以下属性:(返回日期、预订日期、参考客户(客户 * 编号)、参考位置(位置 * 编号)、参考保险(保险 * 编号)、预订 * 编号、参考汽车(汽车注册编号)、金额)
UPDATE BILL AS A
JOIN BOOKING AS B ON A.Booking_num = B.Booking_num
SET A.Total_Amount = B.amount + A.Service_Fees;
请帮助我修复错误
1条答案
按热度按时间xriantvc1#
像这样?
或者,使用
merge
(更简单):