用rowid作主键排序,rownum伪列转成实列 select * from (select t.*, rownum row_num from t order by t.rowid) tt where row_num > 1000 and row_num <= 2000; 如果记录没有发生变化的话,取出的值不会有重复。
rownum没执行成功啊~ row_num between 0 and 1000是可以的, 但是这样:row_num between 1 and 1000 就不行了~ row_num 的起点一定是要0?
select * from (select t.* from table_name t where rownum<30 order by f_id) where rownum<10 order by f_id 取出的是第20-30行数据。
select * from (select b.*, rownum rn from (select a.owner,a.table_name,a.num_rows from all_tables a where a.num_rows is not null order by a.num_rows desc)b) c where c.rn<=50;
select *
from (select t.*, rownum row_num
from t
order by t.rowid) tt
where row_num > 1000 and row_num <= 2000;
如果记录没有发生变化的话,取出的值不会有重复。
但是这样:row_num between 1 and 1000 就不行了~ row_num 的起点一定是要0?
取出的是第20-30行数据。
(select b.*, rownum rn
from (select a.owner,a.table_name,a.num_rows
from all_tables a
where a.num_rows is not null order by a.num_rows desc)b) c
where c.rn<=50;