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

Home -> Community -> Usenet -> c.d.o.misc -> Re: limiting rows returned ?

Re: limiting rows returned ?

From: Ari Kaplan <akaplan_at_psycfrnd.interaccess.com>
Date: 1997/04/17
Message-ID: <5j61ko$mad@psycfrnd.interaccess.com>#1/1

gopal_at_astro.temple.edu (Gopal) writes:

>Hi Folks,
>
>We are using Oracle 7.3.x on Win/Nt 3.51.
>I am new to Oracle and I have a question about limiting the rows
>being returned by a select statement.
>In MS SQL Server or Sybase you can say
>set rowcount 1
>select * from ...
>and only one row will be returned.
>Is there a similar option in Oracle which can be used in SQL plus and
>stored procedure ?
>Regards
>Gopal

Gopal,

Use the ROWNUM clause:

SELECT * FROM ... WHERE ROWNUM < 2;

-Ari Kaplan
Independent Oracle DBA Consultant

<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
<-> For 50+ technical tips, visit my Web Page:                    <->
<->                                                               <->
<->              http://homepage.interaccess.com/~akaplan         <->
<->                                                               <->
<->             email: akaplan_at_interaccess.com                    <->
<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
Received on Thu Apr 17 1997 - 00:00:00 CDT

Original text of this message

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