"dibule" <dibule_at_dibulehome.fr> wrote in message news:<9v574l$bm6$1_at_s1.read.news.oleane.net>...
> Does someone know how to catch the nth record in an Oracle table?
>
Based on replies from the others, here are the summary:
- Work in Oracle 8i
select * from
(select x.*, rownum rn
from
(select * from table order by something) x
)
where rn between FIRST_ROW_TO_SHOW and LAST_ROW_TO_SHOW
/
- Work in Oracle 7.x and beyond
select j1.soda_name, count(*)
from jay_test j1, jay_test j2
where j1.soda_name >=3D j2.soda_name
group by j1.soda_name
having count(*) between FIRST_ROW_TO_SHOW and LAST_ROW_TO_SHOW
/
- Work in Oracle 8i
select * from
(select * from mytable order by something)
where rownum < ( 1 number greater than the one you want to see )
MINUS
select * from
(select * from mytable order by samething)
where rownum < ( number that you want to see )
/
Received on Wed Dec 12 2001 - 20:47:32 CST