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: FAQ sites and Fetch N records

Re: FAQ sites and Fetch N records

From: Lothar Armbruester <lothar.armbruester_at_rheingau.netsurf.de>
Date: 1997/12/08
Message-ID: <768.281T1590T13863405@rheingau.netsurf.de>#1/1

Dennis Park schrieb am 04-Dez-97 15:32:44 zum Thema "FAQ sites and Fetch N records":
>Hi.
 

>I am looking for Oracle FAQ sites. I am also looking for a way to select
>first N records from select statement.

Try this:

select * from your_table
where rownum<=n;

rownum is a preudo column which numbers the rows of the resulting data set. So You can't do the following:

select * from your_table
where rownum=15;

This gives no result because every row selected get rownum=1 which is <>15. So the row isn't selected an the next row checked again gets rownum=1...

>Thanks in advance.
>Dennis

Hope that helps,
Lothar

--
Lothar Armbrüster       | lothar.armbruester_at_rheingau.netsurf.de
Schulstr. 12            | lothar.armbruester_at_t-online.de
D-65375 Oestrich-Winkel |
Received on Mon Dec 08 1997 - 00:00:00 CST

Original text of this message

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