Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Restrict number of rows returned?
On Fri, 29 Dec 2000 10:13:56 -0500, "tore" <TBostrup_at_teamia.com> wrote:
>Is there a way in Oracle (8.0.5) to restrict the number of rows returned
>from a query (using SQL Worksheet or SQL*Plus)?
>
>(Something similar to either SELECT TOP n * or SET ROWCOUNT n in SQL
>Server).
>
>The restriction must be carried out on the server side since I am testing
>some queries that return large result sets over a slow communications linkto
>review the results of a "batch" application.
>
>
You can use ROWNUM, which counts the amount of output lines.
SELECT Moo FROM Cow WHERE ROWNUM < 5;
Note, that as ROWNUM is output lines, using WHERE ROWNUM > 1 would never output any lines.
Brian Received on Fri Dec 29 2000 - 09:34:32 CST
![]() |
![]() |