Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Limiting results of a query to a range of rows
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