Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: First 20 records only
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 CorpReceived on Fri Jun 08 2001 - 10:21:53 CDT