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: How to select only the first 20 rows in a SQL statement

Re: How to select only the first 20 rows in a SQL statement

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Wed, 13 Oct 1999 12:27:16 +0200
Message-ID: <7u1mt6$ghd$1@oceanite.cybercable.fr>


To select the first 20 rows you can use:

select * from <table> where rownum <= 20;

for the next 20 rows:

select * from <table> where rownum <= 40 minus
select * from <table> where rownum <= 20;

and so on:

select * from <table> where rownum <= <n>*20 minus
select * from <table> where rownum <= <n-1>*20;

--
Regards

Michel

Loo Kean Fui <lookf_at_novasprint.com> a écrit dans le message : 38045732.306D9968_at_novasprint.com...
> Hello
>
> Can anyone help ?
>
> I need to issue an SQL statement (either select, delete or update) that
> I want to perform only on the first 20 rows returned and then
> subsequently repeat the statement on the next 20 rows and so on and so
> forth
>
> Is there any way I can write sucha statement?
>
>
> --
> L OO
> Kean Fui
>
>
Received on Wed Oct 13 1999 - 05:27:16 CDT

Original text of this message

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