select * from table where rownum between 100 and 200;

解决方案 »

  1.   

    select * from table where rownum between 100 and 200;
      

  2.   

    select a.* from table_name a,(select rownum bb from table_name) b where b.bb between 100 and 200
      

  3.   

    如果不用嵌套的话,怎么能取的到数据的呢?select * from table where rownum between 100 and 200;像这种取法的话,肯定是取不到数据的了。。
      

  4.   

    楼上你的方法不行的吧?
    其实我觉得这种取法也没什么意义,要取的话可以用minus
    select * from table where rownum <= 200 
    minus
    select * from table where rownum <= 100
      

  5.   

    mosaic(影子)你的那种方法有问题,我觉得Drate(小虫([email protected]))的观点很对,赞成使用嵌套
      

  6.   

    mosaic(影子),不好意思,你的方法还是可以的,我试验的时候没有主意替换表名称,不好意思
      

  7.   

    用rownum为什么不可以,只是可能不是他所要的数据而已,但是如果他并不要求是按照一定顺序排序,那么缺省情况下用rownum作为条件就可以了
      

  8.   

    我得目的是如果数据量很大用sql语句只取其中一部分速度会快的多(如有100万数据我只取齐中50万后100数据),如果用嵌套达不到这效果
      

  9.   

    drate:
    select * from table where rownum between 100 and 200;
    像这种取法的话,肯定是取不到数据的了。。
    我刚才在9ir2下建了一个表运行,没有问题啊,可以选出数据
      

  10.   

    select * from (select * from table where rownum<=200) where rownum>100;
      

  11.   

    http://www.csdn.net/develop/read_article.asp?id=21371
      

  12.   

    sorry!select * from (select rownum rid,tbname.* from tbname where id<=200) t where id>100;
      

  13.   

    mosaic(影子),你的方法取的是1到200之间的记录
      

  14.   

    letsflytogether(恨!不能拥有天下所有的财富,然后平分)你的方法去不到数据
      

  15.   

    select * from (select * from table where rownum<=200) where rownum>100;