我需要从表'customers'中显示256到700行。 Customers表可以包含数百万行。 Customers表具有在'cust_id'
上定义的主键答案 0 :(得分:1)
可能最快的方法就是这样:
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;