Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help with Psudo Column in SQL Statement
On Aug 29, 9:12 am, "fitzjarr..._at_cox.net" <fitzjarr..._at_cox.net> wrote:
> On Aug 29, 8:52 am, "ame..._at_iwc.net" <ame..._at_iwc.net> wrote:
>
>
>
> > Hi All,
>
> > I have a query in which I need the first column to basically be the
> > row number. This is not the ROWNUM psudo column, just simply a
> > counter. The query is below. I basically need the number of the row
> > in the result set.......
>
> > Any ideas how I can implement this into the current query???
>
> > Thanks for your help.
>
> > SELECT NULL, m.comp_name, m.ticker, NVL(sd.avg_rating,-9999),
> > NVL(ROUND(sd.avg_rating_pr,2),-9999),
> > NVL(sd.num_up_rating_1w,-9999),
> > NVL(sd.num_dn_rating_1w,-9999)
> > FROM master_table m, stock_data sd
> > WHERE m.m_ticker=sd.m_ticker(+) AND avg_rating IS NOT NULL AND
> > m.m_ticker IN
> > (SELECT m_ticker FROM comp_ind WHERE ind_code = UPPER('197'))
> > ORDER BY sd.avg_rating, m.comp_name;
>
> > So:
>
> > 1 ...data
> > 2 ...data
> > 3 ...data
> > etc......
>
> Why won't ROWNUM suffice?
>
> David Fitzjarrell
Only problem is that rownum is not in order.......I need it in numerical order....... Received on Wed Aug 29 2007 - 09:15:40 CDT
![]() |
![]() |