Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Get first 10 records?
If you DONT have an ORDER-BY:
select <SEL-LIST> from <FROM-LIST> where <WHERE-PREDICATES> and rownum < 11
If you have an ORDER-BY:
select <SEL-LIST> from (select <SEL-LIST>, rank() over (order by <ORDER-BY>) as r
from <FROM-LIST> where <WHERE-PREDICATES>) where r < 11
RANK() is an analytic function (similar to Time Series option/cartridge in 8.0.x releases). See the "Datawarehousing guide" for more details on analytic-functions.
/Venkat
harry wrote:
> Using Oracle 8i 8.1.7
>
> Is it possible to return just the first say 10 records from a select statment?
>
> thanks
>
> harry
![]() |
![]() |