Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Question: Finding the nth row in a table

Re: Question: Finding the nth row in a table

From: David Russell <user_at_msn.com>
Date: 1997/11/25
Message-ID: <01bcf9e8$3bd86ea0$594195c1@thor>#1/1

I am afraid that this is not strictly true, ROWNUM is caculated from the row source, before any sorting occurs. This means if you use ROWNUM in queries that perform sorts the results will be inconsistent.

Regards
David Russell

Heber Ferraz-Leite <hferraz_at_via.at> wrote in article <347a8aba.6540154_at_news.via.at>...
> On Mon, 24 Nov 97 18:18:49 GMT, ndnguyen_at_ix.netcom.com (Nguyen Nguyen)
> wrote:
>
> >Does anyone know that best way to find the nth row in a table?
> >I tried to use rowid, but it doesn't seem to work. Is using the
> >function chartorowid() the right approach?
>
> select whatever from atable where rownum=n oder by whatever;
>
> You need the order by in this case, since you need to tell the
> database you want the nth according to this ordering. Otherwise you
> will receive a random order. (Not really random, but you can't
> control it)
>
>
> Heber
> ---
> hferraz_at_via.at
>
  Received on Tue Nov 25 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US