Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Which is the best way to select the Nth row ?
List all rows in a table and show the list's row number for each record:
select rownum r, A.* from my_table A
/
Select the 55th row from a (arbitrary) list of records in table A:
select * from
( select rownum r, A.* from my_table A)
where r = 55.
/
Select every 5th record from a list of records in table A:
select * from
( select rownum r, A.* from my_table A)
where mod(r,5) = 0
/
"Francesco Marchioni" <Francesco.Marchioni_at_lastminutetour.com> wrote in
message news:908aeg$qs0$1_at_marte.lastminutetour.com...
> Hello,
> I need a very simple task. A statement that SELECTS the Nth
> row from a table. Reading from manuals I cannot find a single
> statement to do it....as far as I understand you have to work with
> ROWID, issuing a few commands to achieve it, but I do hope there's a
faster
> way
> to do it.....isn't there ?
> Thanks
> Francesco
>
>
>
Received on Wed Dec 20 2000 - 14:17:15 CST
![]() |
![]() |