17,382
社区成员




select *
from table1
where flag<>1 and rownum<1001
create or replace procedure getThData
(
instart number, --第几次取
outCursor out sys_refCursor
)
is
begin
select * from tablename where primaryKey in
(select primaryKey from tablename where rownum<1000*instart+1000)
and rownum<1000 order by primaryKey desc;
end;
select * from (select deptno,rownum rn from emp where state<>0) where rn <=1000
select * from (select a.*,rownum rn from tb) a where a.rn>=1 and a.rn<=1000
select * from (select deptno,rownum rn from emp) where rn between 0 and 1000
--类似与 SQL SERVER 的TOP的 ORACLE写法是
select * from (select * from tablename order by 某字段) where rownum<1001
--这就是按某字段排列的前一千条数据