Thursday, March 6, 2008

Finding rows between nth to mth in Oracle

select *
from
(select a.*, rownum rnum
from
(select id, data
from t
order by id) a
where rownum <= 151
)
where rnum >= 148
/

select * from (select t.*, rownum rnum from t where rownum <> 140
/

No comments: