根据某一条件可查得很多条记录,如何只查得前10条记录?????

解决方案 »

  1.   

    select * from table1 where rownum<11
      

  2.   

    select * from (select t.*,rownum r from t) a
    where a.r<=10;
      

  3.   

    如果是前10条,用yuanhelei(聪明的Black Angel)的就可以
    select * from table1 where rownum<11如果是中间的,例如10到20条,就要用njhart2003()的
    select * from (select t.*,rownum r from t) a
    where a.r>=10 and a.r<=20;
      

  4.   

    select * from (select * from table_a order by shijian desc) where rownum<11
      

  5.   

    select * from table  where rownum<11