Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: simple SQL question
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
![]() |
![]() |