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: First 20 records only

Re: First 20 records only

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 08 Jun 2001 11:21:53 -0400
Message-ID: <qar1itgsc47ugt46bmr29fgpefk31ecmfb@4ax.com>

A copy of this was sent to "Jack" <No_at_Mail.Please> (if that email address didn't require changing) On Fri, 8 Jun 2001 12:08:27 +0100, you wrote:

>Hi
>Can you please tell me how to 'select' only (the first) 20 records of a
>table?
>is it ;
> select * from tableA sample (20)
>
>Thanks
>

that'll get 20% of the rows in the table.

select * from tablea where rownum <= 20;

--
Thomas Kyte (tkyte_at_us.oracle.com) Oracle Service Industries
Howtos and such: http://asktom.oracle.com/ http://asktom.oracle.com/~tkyte/
Oracle Magazine: http://www.oracle.com/oramag
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Fri Jun 08 2001 - 10:21:53 CDT

Original text of this message

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