Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Selecting a range of records
On Sun, 8 Jul 2001, gjlinker_at_oraxcel.com wrote:
> You can execute e.g. select * from emp where rownum between 10
> and 30. Note that you will get an arbitrary set of 20
> records!. To be more precise use order by.
It isn't as simple as this. A between is implicitly > x and < y. The > x will make the use of rownum not find anything.
He needs to do what Tom Kyte posted in misc. His snippet was like this
select ename, empno
from ( select emp.* , rownum R
from emp where rownum <= 10 )
So, Abel would want to do
select whatever.*
from (select whatever.*, rownum R
from whatever where rownum < 112)
-- Galen I don't want to be the rock. Yeah, okay, what do you want to be? I want to be the piece of glass.Received on Sat Jul 21 2001 - 16:32:19 CDT
![]() |
![]() |