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.
| Author |
Topic |
|
sent_sara
Constraint Violating Yak Guru
377 Posts |
Posted - 2008-09-23 : 04:40:05
|
| Table name:onsite_plstatement_tmpsno name amt1 AA 100.00 2 BB 100.00 3 cc 200.004 DD 300.005 Total nullI need to update the 5th Total column 700.00my try is,can any one correct the below query:update Aset A.amt=sum(A.amt) from onsite_plstatement_tmp Awhere guid=@guid and sno between 1 and 4Note: for the sno=5 the total value should be 700.00 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-23 : 04:49:53
|
| [code]update onsite_plstatement_tmpset amt=(select sum(amt) from onsite_plstatement_tmp where guid=@guid and sno between 1 and 4)where sno=5[/code] |
 |
|
|
|
|
|