Как использовать запрос обновления с case?
я хочу использовать update query using case, with from
неправильный синтаксис рядом с
Что я уже пробовал:
update A_SalaryConsolidated set bonus=case when a.final_payable >bonus then bonus else (bonus+a.final_payable) from (select empid,final_payable from Bonus inner join monthdigit on month=monthView where monthnumber= 5 and year = 2017 and Bonus.empid in(select a.empid from(select empid from Bonus inner join monthdigit on month=monthView where monthnumber=5 and year=2017 and final_payable>0 and unitid=145) as a )) as a inner join A_SalaryConsolidated on a.empid=A_SalaryConsolidated.staffid where month ='July' and year = '2017'