Oracle 查詢更新. 把一個表的字段數據.根據管理關系.更新到另外一個表字段


//查詢更新  更新后的數據查詢只能出現一個值. 否則報錯.

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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM