本帖最后由 sparadise1003 于 2012-02-26 07:48:15 编辑

解决方案 »

  1.   

    首先你必须有一个字段来表明插入的顺序,如登录时间等,因为oracle表中记录是不会有先后次序的。
    如果是按loginTime时间顺序来插入记录,则可用如下语句来查询(类似分页语句):
    select * from (
        select rownum rn, a.* from (select * from userTable order by loginTime) a where rownum<=110)
        where rn>100 and userName='张三';
      

  2.   

    Oracle不会自动记录你插入记录的顺序。必须增加字段来自己标明插入顺序。
      

  3.   

    你应该有个序列号,或是时间字段,这样可以得到你说的100条记录之后的东西.
    --假设根据loginTime来区分先后select m.userName , m.loginTime , m.title , m.content from
    (
      select t.* , row_number() over(order by loginTime) px from usertable t
    ) m
    where xh > 100 and username = '张三'--假设你有个序号,字段名为xhselect m.userName , m.loginTime , m.title , m.content from
    (
      select t.* , row_number() over(order by xh) px from usertable t
    ) m
    where xh > 100 and username = '张三'