select * from (select rownum no,col1,col2,...,coln from tbname group by col1,col2,...coln)
where no>(select count(0)-6 from tbname);

解决方案 »

  1.   

    select * from (select rownum no,col1,col2,...,coln from tbname
    where no>(select count(0)-6 from tbname) order by no desc;
    ORARichard(没钱的日子好难过啊)兄可能忘了加order by :)
      

  2.   

    select * from (select rownum no,col1,col2,...,coln from tbname)
    where no>(select count(0)-6 from tbname) order by no desc;
    把)给弄丢了,不好意思!
      

  3.   

    SQL> select  * from bb;        ID
    ----------
            10
             1
             8
             6
            15
           150
            16
            19已选择8行。SQL> select id from(
      2  SELECT id,
      3   row_number()
      4   OVER (PARTITION BY 1
      5         ORDER BY id desc NULLS LAST) top_6
      6  FROM bb) b
      7  where b.top_6<=6;        ID
    ----------
           150
            19
            16
            15
            10
             8已选择6行。
      

  4.   

    selec * from (selec * from b order by a desc) where rownum<7