我需要显示表'customers‘中的第256到700行。Customers表可以有数百万行。Customers表具有在'cust_id‘上定义的主键
发布于 2013-05-22 05:55:39
可能最快的方法是这样的:
select c.*
from (select rownum as seqnum, c.*
from customers c
where rownum <= 700
) c
where seqnum >= 256;唯一需要注意的是,在select查询中没有定义行的顺序。要获得正确的顺序,您应该使用:
select c.*
from (select rownum as seqnum, c.*
from (select c.*
from customers c
order by cust_id
) c
where rownum <= 700
) c
where seqnum >= 256;https://stackoverflow.com/questions/16680116
复制相似问题