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

Home -> Community -> Usenet -> c.d.o.misc -> Re: simple SQL question

Re: simple SQL question

From: Nandakumar <nanban_at_my-deja.com>
Date: Wed, 04 Aug 1999 15:09:04 GMT
Message-ID: <7o9l26$gai$1@nnrp1.deja.com>


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 - 10:09:04 CDT

Original text of this message

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