Average of grouped rows in Sql Server

混江龙づ霸主 提交于 2019-11-28 11:56:32

Is this what you want?

select column1, avg(column2) from table group by column1

simple

select AVG(Column2) from table group by Column1

doesn't work?

Baaju
SELECT column1, AVG(column2) 
  FROM "Insert table name"
GROUP BY column1 
SELECT Column1, AVG(Column2) FROM test GROUP BY Column1;

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...

Amar Agrahari

Execute the following SQL from average :

select column1,avg(column2) from tablename group by column1;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!