Select title, credits, courseid, avg(grade) as AVG_Grade group by title, credits, courseid
having avg(grade) = (select min(avg(grade)) from exam); 这是我的查询,用来找出GPA最差的课程,我想用嵌套查询来完成,但这似乎不起作用。
我必须显示每个用户的名字和姓氏,年份作为studyYear,年龄,平均成绩,以及一般平均成绩。总平均成绩I需要这样计算: Sum(AverageGrade)/ total number of grades [userID][LastName] [AverageGrade] 我的问题是共同平均成绩的总和。
$avg = mysql_query("SELECT subject, gradeone, gradetwo, gradethree, ((gradeone + gradetwo + gradethree) / 3) as average FROM grades");
$q = mysql_query("SELECT * FROM newstudent AS n JOIN grades AS g ONn.id = g.id ORDER BY n.id") or die (mysql_er