update bg_forward_budget
set
amount = (select amount
from bg_forward_master
where forward_id = bg_forward_budget.forward_id
and bg_type ='FW'
and budget_year_control
=2555)
, amount_balance =(select amount
from bg_forward_master
where forward_id =
bg_forward_budget.forward_id
and bg_type ='FW'
and budget_year_control
=2555)
,
bf_amt =(select amount
from bg_forward_master
where forward_id =
bg_forward_budget.forward_id
and bg_type ='FW'
and budget_year_control
=2555)
where bg_type ='FW'
and budget_year_control =2555
and amount = 0
update bg_forward_budget
ตอบลบset (amount, amount_balance, bf_amt) = (select amount , amount , amount
from bg_forward_master
where forward_id = bg_forward_budget.forward_id
and bg_type ='FW' and budget_year_control =2555)
where bg_type ='FW'
and budget_year_control =2555
and amount = 0