Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Can you tell what is wrong in this query ?UPDATE DWH sum(ISNULL (aBCS,0)+ ISNULL (bISS,0)+ ISNULL (cITO,0)+ ISNULL (Other,0)) as TotalWHERE ID=20110225Basically I have database table with columns and total is calculation of those columns. I updated the column but total column didn't get updated. so i need to run this query to update total column.
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts
Posted - 2011-07-12 : 15:54:16
maybe:
UPDATE DWH From DWH AInner Join Select Id, total = sum(ISNULL (aBCS,0)+ ISNULL (bISS,0)+ ISNULL (cITO,0)+ ISNULL (Other,0)) as TotalWHERE ID=20110225Group By ID) B