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: Limiting the number of returned rows with Oracle

Re: Limiting the number of returned rows with Oracle

From: DNP <High.Flight_at_btinternet.com>
Date: 2000/06/06
Message-ID: <393C9940.2EA7@btinternet.com>#1/1

(emp = sample table)

SQL>SELECT  *  
  2>FROM    emp
  3>WHERE   rownum < 6;


Note this doesn't work for sorts i.e. you can't approximate a 'Top 10 by size' type of query with rownum.

David P. OCP (DBA) MCP (TCP/IP)

Glasgow, Scotland.


converse_at_tanyelcp650.brightware.com wrote:
>
> Is there a way to limit the number of returned records to a given number
> with Oracle with SQL?
>
> Something like: "select * from table and return first five rows"
>
> thanks,
>
> Cem
Received on Tue Jun 06 2000 - 00:00:00 CDT

Original text of this message

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