Oracle 查询更新. 把一个表的字段数据.根据管理关系.更新到另外一个表字段

时间:2021-12-15 14:59:23

//查询更新

Update CAT_P_BUILDING_PRICE A
set A.APPROVAL_PRICE = (Select TARGET_APPROVAL_PRICE FROM_NO
from CAT_P_PRICE_ADJUSTMENT B
where FROM_NO =:From_No and A.Building_Id=B.Building_Id),
A.PRESALE_UNITPRICE = (Select TARGET_PRESALE_UNITPRICE FROM_NO
from CAT_P_PRICE_ADJUSTMENT B
where FROM_NO =:From_No and A.Building_Id=B.Building_Id)
where A.BUILDING_ID IN
(Select BUILDING_ID FROM_NO
from CAT_P_PRICE_ADJUSTMENT B
where FROM_NO =:From_No)

AND A.STAGE_ID IN
(Select STAGE_ID FROM_NO
from CAT_P_PRICE_ADJUSTMENT
where FROM_NO =:From_No