本文介绍了如何使用案例更新查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用案例更新查询,来自
附近的语法不正确
我尝试了什么:
i want to use update query using case, with from
incorrect syntax near from
What I have tried:
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'
推荐答案
这篇关于如何使用案例更新查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!