一条分页的SQL语句select * from (select rownum id,t.* from (select * from music  ORDER BY classid DESC) t
where rownum<20) tt where tt.id>10;一条分页的SQL语句
select * from (select my_table.*, rownum as my_rownum from (select name, birthday from employee order by birthday ) my_table where rownum <120) where my_rownum>=100

解决方案 »

  1.   

    游标也是通过SELECT来确定记录数量啊
    可不可以试一下SQL条件每次取出10条记录,比如说前面有排序字段
      

  2.   

    freddy2003() 大哥 能用QQ或MSN给我解释一下你的想法吗?
    我的QQ:44030746
    MSN:[email protected]
      

  3.   

    关键是排序后只能取出前10条,那接下来的10条呢!luxuezhu(卢冲)你说呢!
      

  4.   

    假设我的表tt有一个自动编号的id(假设有15条记录,通过id升序查询):
    我是这么想的,第一次查询时查出10条记录,记下最大的id,通过url?lastid=重写来实现第2次查询:
    语句为:
    select * from tt where id>=lastid and rownum<11;
      

  5.   

    用freddy2003的方法,先判断最大行数,然后用循环10条10条的取,。