Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to select only the first 20 rows in a SQL statement
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