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 |
|
Priyamvada
Starting Member
1 Post |
Posted - 2012-01-08 : 01:15:52
|
| I am working on an asp.net applicationI want to add the sum of 2 columns from same table to third column in different table.Eg: Student_Total=Student_history+Student_geography.Student_history and Student_geography represent marks in respective subjects i want to add marks from these subjects in table Student_Marks to Sum_Total column in table named as Results.How to go about it.Grateful if you would help mepriya |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-01-08 : 02:23:55
|
| [code]UPDATE tt.Sum_Total = t1.Student_Total FROM Student_marks tCROSS APPLY (SELECT Student_history + Student_geography AS Student_Total FROM Student WHERE Student_ID = t.Student_ID )t1[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|