楼上的测试过吗?
如果要用rownum作为过滤条件,需要用子表的。
select * from tablename where rownum between 1001 and 2000 order by rowid
这样的写法可能会出现0条记录返回的情况。
如果一定要使用
如果要用rownum作为过滤条件,需要用子表的。
select * from (select *,rownum rnum from tablename where rownum order by rowid)
where rnum between 1001 and 2000
比较好
spool file1
select * from tablename where rownum between 0 and 1000 order by rowid
spool off;
spool file2
select * from tablename where rownum between 1001 and 2000 order by rowid
spool off;
spool file3
select * from tablename where rownum between 2001 and 3000 order by rowid......
可測試一下,因為排序是按rowid排,其rownum應該會與rowid對應,這樣就不會select重復的或漏掉。。。