select max(avg(grade))
from tab
group by sno

解决方案 »

  1.   

    1.根据学号进行分组
    2.对分组后的数据算平均值 用avg()函数;然后取最大值
      

  2.   

    select t2.sno from
    (select t1.*
    (select sno,avg(grade) pjf from sc group by sno) t1
    order by pjf desc) t2
    where rownum=1
      

  3.   

    如果考虑多名学生并列第一且全部列出,则:
    select t2.sno from t2 where t2.pjf in
    (select t2.pjf from
    (select t1.*
    (select sno,avg(grade) pjf from sc group by sno) t1
    order by pjf desc) t2
    where rownum=1)
      

  4.   

    select sno from (select sno, avg(grade)ag from sc group by sno order by ag desc)
    where rownum=1