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 returned data from SQL Select Satement

Re: Limiting returned data from SQL Select Satement

From: Keith E. Moore <kmacs_at_gandalf.kmacs.com>
Date: 1998/02/18
Message-ID: <slrn6eka5d.1m0.kmacs@gandalf.kmacs.com>#1/1

On Tue, 17 Feb 1998 11:16:47 -0600, AMARENDRA B NETTEM <nettama_at_charlie.cns.iit.edu> wrote:
>
>
>Matthew Chappee wrote:
>
>> Is there a way to limit the number of rows returned from an SQL Select
>> statement? MS Access supported the following:
>>
>> Select Top 10 * from table_name
>>
>> I can't figure out the Oracle equivelant.
>>
>> Thanks,
>>
>> Matthew
>
> Hi,
>Use ROWNUM pseudo column to limit the no. of rows returning.
>
>SELECT * FROM TABLE_NAME
>WHERE ROWNUM <11;
>

  Just as a note/warning, ORDER BY and GROUP BY will cause unexpected results when using ROWNUM

>Hope This Helps
>
>AMARENDRA
>Oracle DBA
>
>--
>*****************************************************************
>AMARENDRA B NETTEM
>Oracle Certified DBA (OCP)

-- 
-- Keith Moore
   President
   KMA Computer Solutions, Inc.

-- 
/*----C/C++--Java--VB--Pro*C--SQL--OCI--Java--Delphi--ODBC--COBOL-----* 
 *        When the project must be saved at all costs:                *
 * KMA Computer Solutions, Inc.   Project Troubleshooting/Recovery    *
 *---------Linux---AIX---HPUX---SYSV---Novell---NT---OS/2---'95-------*/
Received on Wed Feb 18 1998 - 00:00:00 CST

Original text of this message

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