SELECT CNAME,CTEACHER, 最高分, 最低分,平均分, 选课人数
FROM
( SELECT MAX(SCGRADE) AS 最高分,
MIN(SCGRADE) AS 最低分,
AVG(SCGRADE) AS 平均分,
COUNT(SNO) AS 选课人数
ROM C
ROUP BY CNO
) AS z
SELECT
MAX(SCGRADE) AS 最高分,
MIN(SCGRADE) AS 最低分,
AVG(SCGRADE) AS 平均分,
COUNT(SNO) AS 选课人数
FROM C
GROUP BY CNO
难道我理解错了,不是这么简单吧!