select your_num from table_name where rownum <= 3   group by your_num

解决方案 »

  1.   

    sorry:select * from (
    select distinct your_num from table_name order by your_num) where rownum <=3
      

  2.   

    select col from
    (select col,row_number() over(order by col) rnum from tbname) t
    where rnum<4;
      

  3.   

    不好意思是前三名.有可能其中有一样的值.如下
    id   score
    1     100
    2     78
    3     88
    4     68
    5     98
    6     88
    结果如下
    1  100
    5  98
    3  88
    6  88
      

  4.   

    select * from(
    SELECT col1,col2,col3,
     row_number()
     OVER (PARTITION BY ny
           ORDER BY 成绩 desc NULLS LAST) top_3
    FROM table) b
    where b.top_3<=3;
      

  5.   

    select * from(
    SELECT col1,col2,col3,
     row_number()
     OVER (ORDER BY 成绩 desc NULLS LAST) top_3
    FROM table) b
    where b.top_3<=3;
      

  6.   

    select col from
    (select col,rank() over(order by col) rnum from tbname) t
    where rnum<4;
      

  7.   

    老大,好像不行了.只能得到前三条记录.我是说要
    id   score
    1     100
    2     78
    3     88
    4     68
    5     98
    6     88
    结果如下
    1  100
    5  98
    3  88
    6  88
      

  8.   

    sorry!select col from
    (select col,dense_rank() over(order by col) rnum from tbname) t
    where rnum<4;
      

  9.   

    ok,谢了.这个贴不是我开的.我开一个收分.要不要.顺便问一下.什么学sql.有什么好资料没有.
      

  10.   

    Select top 3 col,num from Table order by num desc