select id,company from tablename where company='aaa' and rownum>=3 order by id
(oracle数据库)

解决方案 »

  1.   

    select id,company from table1 where company='aaa' and rownum>=3 and rownum<=6 order by id
      

  2.   

    select id,company from 表1 where company='aaa'
    and id not in(select top 2 id from 表1 where company='aaa' order by id)
    order by id
      

  3.   

    你可以 把 所有记录先放在一个datatable 里面 然后把 从第3行开始的记录 重新放到另外一个 datatable里面  返回出来
      

  4.   

    rownum在sqlserver里面 没有把  ?用drone的方法 可行
      

  5.   

    select top 4 id,company from 表1 where company='aaa'
    and id not in(select top 2 id from 表1 where company='aaa' order by id)
    order by id
      

  6.   

    TO:shenyisyn(魔法师)
     从第3行开始的记录 重新放到另外一个 datatable里面  返回出来 怎样从第3行记录开始?