Re: Limiting Rows Returned in Query

From: Pratap Singh <prsingh_at_cisco.com>
Date: 1996/11/11
Message-ID: <3287A4FA.62BF_at_cisco.com>#1/1


Tony Sollars wrote:
>
> Joe Nardone wrote:
> >>
> >> text removed
> >>
> > Note however that this will not work (correctly) if you use any
> > kind of ORDER BY clause; rownum is assigned before that sort, so
> > you will not get the rows you expect.
> >
> > text removed
> >
> > Joe
>
> What happens if the ORDER BY clause corresponds exactly with the primary
> key on the table ? From experimentation this seems to work, but it is
> probably because the rownum is assigned in primary key order and the
> order by clause then has no effect. Does anyone have any evidence to
> back this up ?
>
> Tony
> sollarst_at_cableol.net

The number remains the same only if order by is not changing the sequence
of rows returned.

Most of the times rows are returned by the sequence of Primary Key. This has to do with use of index in retrieving the rows.

Pratap Received on Mon Nov 11 1996 - 00:00:00 CET

Original text of this message