Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: How to use 'Top' in oracle?
thanks for the quick response.
-- Niall Litchfield Oracle DBA Audit Commission UK "Jonathan Lewis" <jonathan_at_jlcomp.demon.co.uk> wrote in message news:969963920.23651.0.nnrp-10.9e984b29_at_news.demon.co.uk...Received on Tue Sep 26 2000 - 06:12:22 CDT
>
> There is a change in 8.1, and rownum can be applied after order by,
> but I think you have to use an inline view to achieve it, viz:
>
> select * from
> (
> select product_name
> from product
> order by price DESC
> )
> where rownum<=3
> ;
>
> This is a side-effect of allowing ORDER BY inside
> views rather than an explicit re-implementation of
> the ROWNUM concept.
>
>
> --
>
> Jonathan Lewis
> Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk
>
> Niall Litchfield wrote in message <8qpsat$4j5$1_at_soap.pipex.net>...
> >"NetComrade " <andreyNSPAM_at_bookexchange.net> wrote in message
> >news:37ed628d.26437414_at_news.earthlink.net...
> >> select product_name from product order by price where rownum<=3 in 8i
> >> only.
> >
> >Does this mean that rownum has changed in 8i to work on the basis of
rank. I
> >must have missed that one if it did, and I kinda doubt it. Jonathon and
> >basavaraj have given the two text book ways to achieve this.
> >
> >
> >--
> >Niall Litchfield
> >Oracle DBA
> >Audit Commission UK
> >
> >
>
>
![]() |
![]() |