I'm trying to update a column of one tbl with the sum of several columns of another joined tbl and receive the following error:
Msg 157, Level 15, State 1, Line 2
An aggregate may not appear in the set list of an UPDATE statement.
How would I accomplish this? Thanks!!
set Paid = (Sum(a.LossPaid-a.LossRecoveredSub-a.LossRecoveredSal-a.LossRecoveredOther)) from p
where e..ClaimNumber = p.ClaimNumber)
from SAP2007ClaimMaster e
where exists (select null from p
where e.ClaimNumber = p.ClaimNumber)