Re: simple SQL question

From: Nandakumar <nanban_at_my-deja.com>
Date: 1999/08/04
Message-ID: <7o9l26$gai$1_at_nnrp1.deja.com>#1/1


This will not work as rownum is assigned to selected rows before they are sorted in any order. The only way out is use a CURSOR on the ordered list and fetch first 10 rows.

In article <37A84570.D21838B4_at_Boeing.com>,   Martin Douglas <Martin.Douglas_at_Boeing.com> wrote:
> Alternatively, you could add a column that stores an integer from a
> sequence and then select from the table ordering by the seq_col in
> descending fashion and add a where clause requesting rownum <= 10.
>
> Best Regards,
>
> -Martin-
>
> kev wrote:
> >
> > Hi,
> >
> > Just wondering - what's the best way to retrieve, say, the latest
 ten
> > entries to a table.
> > Does Oracle have a MAXROWS func (I couldn't find one in the docs)
> >
> > Thanks,
> >
> > - Kev
>

--
Nandakumar
Systems Analyst
New York
(N.Kumar_at_rocketmail.com)


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Wed Aug 04 1999 - 00:00:00 CEST

Original text of this message