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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Limiting results of a query to a range of rows

Re: Limiting results of a query to a range of rows

From: Richard Armstrong <richard.armstrong_at_juno.demon.co.uk>
Date: 2000/05/28
Message-ID: <959539889.4836.0.nnrp-10.9e9809ca@news.demon.co.uk>#1/1

I think you need to enclose the query and use the rownum pseudo column like this :-

select * from
(SELECT * FROM widgets ORDER BY widget_id) where rownum <= 10 ;

David F. Newman <dave.newman_at_webct.com> wrote in message news:7xbt23iyuy.fsf_at_webct.com...
> Hi,
> Say you have a query such as;
>
> SELECT * FROM widgets ORDER BY widget_id;
>
> Is there a way to alter the above query so that it only returns
> rows 1 through 10, or 11 through 20 of the results? The query may
> also have where clauses such that saying
>
> WHERE widget_id >= 1 AND widget_id <= 10
>
> might not be valid to get what I'm asking for.
> Thanks for any help.
>
> --
> David F. Newman
> dave.newman_at_webct.com
Received on Sun May 28 2000 - 00:00:00 CDT

Original text of this message

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