sql有方法可以取记录的前100条如果
我需要取10000-10500条呢 我又不想将前面的数据一起取出
请教有解决的办法吗?

解决方案 »

  1.   

    use rownum:
    select * from (select rownum rn,a.* from table)b
    where b.rn between 10000 and 10300
      

  2.   

    你应该有一个定位的标准,如果没有就采用:ROWID。
    select * from table where rownum <= 300 and rowid >= (select max(rowid) from table where rownum <= 1000);
    如果有排序则可以定位到排序的列,加条件即可。
      

  3.   

    select * from table where rownum < number1 minus select * from table 
     where rownum < number2 ;
     the number1 must be larger than number1