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: Restrict number of rows returned?

Re: Restrict number of rows returned?

From: Brian Tkatch <SPAMBLOCK.Maxwell_Smart_at_ThePentagon.com.SPAMBLOCK>
Date: Fri, 29 Dec 2000 15:34:32 GMT
Message-ID: <3a4cae83.3337036890@news.alt.net>

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

Original text of this message

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