| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Question: Finding the nth row in a table
Hi,
Try a variant of the following:
select a.rowid from test a
where
a.rowid > (select max(b.rowid) from test b where rownum < 4)
and rownum < 2
Cheers,
Martyn Jones
@HP GCC Bahrain
In article <347CFE31.76F2_at_blr.sni.de>,
Satish Narasimha <satishn_at_blr.sni.de> wrote:
>
> Hello,
> Can you tell the logic of how you got this idea...?
>
> from
> satish :satishn_at_blr.sni.de
>
> Heber Ferraz-Leite wrote:
> >
> > On Tue, 25 Nov 1997 13:22:18 -0800, "David Russell" <user_at_msn.com>
> > wrote:
> >
> > >I am afraid that this is not strictly true, ROWNUM is caculated from the
> > >row source, before any sorting occurs. This means if you use ROWNUM in
> > >queries that perform sorts the results will be inconsistent.
> >
> > I had written the follwing:
> >
> > >> select whatever from atable where rownum=n oder by whatever;
> >
> > As others have already stated I made a wrong statement. The above
> > select won't work. It would have been nice, but ...
> >
> > Sorry for the mistake. I was too quick to answer and should have
> > thought before. :-(
> >
> > Heber
> > ---
> > hferraz_at_via.at
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
Received on Sat Nov 29 1997 - 00:00:00 CST
![]() |
![]() |