student表(class,name,score)
           soft061    a1   85 
           soft061    a2   90
           soft061    a3   85
           soft062    b1   90
           soft062    b2   58
           soft062    b3   57
           soft063    c1   84
           soft063    c2   98
           soft063    c3   78
要求获得每班成绩最低的那个人的名字

解决方案 »

  1.   

    select b.name
    from( 
          select class,min(score) minscore from student group by  class
    )a, student b
    where a.class=b.class and a.minscore=b.score
      

  2.   

    select class,name from
      (select class,name,score,rank()over(partition by class order by score) rk
        from student)
      where rk=1
      

  3.   

    Select Name From (Select  Class ,Name ,SCORE, Row_Number() over(Partition By Class Order By score) num From STUDENTS
    )
    Where NUM = 1