Update multiple values in a single statement
- by Kluge
I have a master / detail table and want to update some summary values in the master table against the detail table. I know I can update them like this:
update MasterTbl set TotalX = (select sum(X) from DetailTbl where DetailTbl.MasterID = MasterTbl.ID)
update MasterTbl set TotalY = (select sum(Y) from DetailTbl where DetailTbl.MasterID =…