我需要显示表“客户”中的第 256 到 700 行。客户表可以有数百万行。客户表在“cust_id”上定义了主键
问问题
283 次
1 回答
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;
于 2013-05-21T21:55:39.303 回答