SQL:查找平均分数 [英] SQL: Finding Average Score
本文介绍了SQL:查找平均分数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
给出表格,我正在寻找一个查询,以计算给定老师的给定问题的平均分数.
Given the table, I am looking for a query to calculate the average score of a given question for a given teacher.
如果我要像SCHOOLID一样在表中添加另一列,并希望有一个列可以计算该学校给定问题的平均值,那我该怎么做?
If I was going to add another column to the table like SCHOOLID and wanted to have a column that calculated the average for a given question for that school, how would I do that?
在此先感谢您的帮助!
推荐答案
select teacherId, questionid, AVG(Score)
From myTable
group by teacherId, questionid
这篇关于SQL:查找平均分数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文