我在csdn也发的问题,已经得到了答案 http://topic.csdn.net/u/20110708 ... 5e27.html?250130410
SELECT a.班级,a.小组,avg(成绩),var(成绩) FROM 查询1 a inner join (select 班级,小组 from 查询1 group by 班级,小组 having count(*)>=3) b on a.班级=b.班级 and a.小组=b.小组
group by a.班级,a.小组
查询1:
SELECT *
FROM 成绩表 AS a
WHERE 3>=(select count(*) from 成绩表 where a.班级=班级 and a.小组=小组 and a.成绩<=成绩 );
__________________________________________________________________________
再次感谢WWWWA