Average of grouped rows in Sql Server

后端 未结 6 2001
名媛妹妹
名媛妹妹 2020-12-11 01:06

I have an Sql Server Table.. it\'s something like this:

Id ...... Column1 ...... Column2  
````````````````````````````````  
1 ........ 1 ............. 34  
2 ..         


        
6条回答
  •  悲&欢浪女
    2020-12-11 01:49

    This following Query will help for Calculate the average value of a ROW:

     select Avg(A.Tamil + A.English + A.Maths + A.Science + A.Social_Science)/5 As 
     Average
     from MarkTable A, MarkTable B, MarkTable C
     where A.RollNo='14UCA002'
    

    This might helpful...

提交回复
热议问题