Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SELECT TOP N
I don't think that this Statement works. Oracle assings rownum to the records in the order they are fetched and then orders them by the column you specify.
One way of doing this is to declare a cursor order by whatevercolumnyouwant
desc,
fetch thru a loop for the n number of times, get the nth record's value.
Hope this helps..
proctorh_at_email.exide.com wrote in message
<35d07a59.10897539_at_news.mindspring.com>...
>Oracle select range:
>
>select column
> from table
>where condition
> and rownum = n
>
>where n in the nth row number in the result set.
>you can also use <. >, <=, >=.
>
>I don't know if this is Oracle 8 compliant, though.
>: >
>>: > How about if I want the Nth record only and I want N is a parameter
>>: > passed to a stored procedure. Can I do that?
>>: >
>
Received on Fri Aug 14 1998 - 00:00:00 CDT
![]() |
![]() |