甚至都不需要联表 select count(*) from ( SELECT COUNT(DISTINCT sid) num FROM SC s GROUP BY sid HAVING AVG(s.score) > 60) t