具有两个或多个内连接oracle的update语句和计算值也从视图中选择

时间:2016-12-15 19:54:55

标签: sql oracle sql-update inner-join

您好,在下面的代码中我想通过计算我加入的多个表中的值来更新CRVamount。我想弄清楚如何在oracle中完成。我尝试使用一个内连接示例的帮助,我仍然得到FROM关键字未找到预期的下面的

 update
  (Select asset.CRV_AMOUNT as ACRV, cmd.CRV_PERCENT as CRVP, (select CRV$ from recapt.facility_rec_crv_V fac_v where fac_v.fac_code = fac.code AND fac_v.complex_code = fac.complex_code) CRV_TOTAL as CRVT 
  from recapt.asset asset
inner join  recapt.facility_rec fac
  on fac.code = asset.fac_rec_code
  and fac.complex_code = asset.complex_code
inner join recapt.cost_model_detail cmd
  on cmd.cost_model_id = fac.cost_model_id and
  cmd.mf_division_id = asset.mf_division_id) t
  SET t.ACRV = ((CRVP * CRVT)/100);

0 个答案:

没有答案