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: Question: Finding the nth row in a table

Re: Question: Finding the nth row in a table

From: <martyn1_at_ibm.net>
Date: 1997/11/29
Message-ID: <880810775.9546@dejanews.com>#1/1

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



Iniciativa para Data Warehouse

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

Original text of this message

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