Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Row number base on sorting order?

Re: Row number base on sorting order?

From: <kimboon_at_my-dejanews.com>
Date: Thu, 06 May 1999 06:22:42 GMT
Message-ID: <7grcfg$4u8$1@nnrp1.deja.com>


Hi Philippe, Thanks ! It works. But what is RULE hint for ? Any particular reason why it should be used here ?

In article <7gp886$m73$1_at_concorde.ctp.com>,   "Philippe" <parnaud_at_yahoo.com> wrote:
> SELECT /* RULE */ t.col_a from MyTable t, dual d where t.col_a = d.dummy
> (+)
> WHERE rownum < 5
>
> HTH,
> Philippe
>
> kimboon_at_my-dejanews.com wrote in message
> <7gofh6$iva$1_at_nnrp1.dejanews.com>...
> >Hi,
> > I have these data :
> >col_a
> >-----
> > D
> > B
> > A
> > E
> > C
> > F
> > 1. I want to assign a row number in the order of col_a, result
> looks
> >like this :
> >
> >row_no col_a
> >------ -----
> > 1 A
> > 2 B
> > 3 C
> > 4 D
> > 5 E
> > 6 F
> >
> > 2. I want to retrieve the first 4 rows in the order of col_a,
> result
> >looks like this :
> >
> >col_a
> >-----
> > A
> > B
> > C
> > D
> >
> > ROWNUM doesn't help in these cases, as it was assigned before ordering.
> >
> > Any help ??
> > TIA !!!
> >Jinwen
> >
> >-----------== Posted via Deja News, The Discussion Network ==----------
> >http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
>

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu May 06 1999 - 01:22:42 CDT

Original text of this message

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