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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL: Limit Number of Rows Returned

Re: SQL: Limit Number of Rows Returned

From: TurkBear <johng_at_mm.com>
Date: Mon, 18 May 1998 14:26:14 GMT
Message-ID: <35654453.2733140@news2.mm.com>


Todd Haddaway <haddaway_at_umbc.edu> wrote:

>OK,
>
>SQL 101 question - How do I limit the number of rows returned in a
>select. For example, I only want to see the first 10 rows.
>
>I know it's something like:
>
> Select * from table where rows < 11;
>
>Thanks!
>

Close -
Select * from table where rownum < 11;

Note : this does not mean that the first 10 rows ( in any kind of order ) will be returned, but that rows will be returned until a count of 10 is reached - they may not be the 'first' rows in the table, depending on what you mean by 'first'.

Hope this helps, and doesn't further confuse...

John Greco
Oracle DBA Received on Mon May 18 1998 - 09:26:14 CDT

Original text of this message

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