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 Numbers

Re: Row Numbers

From: Angelo Cavallaro <angelo.cavallaro_at_pcm.bosch.de>
Date: Tue, 09 Mar 1999 15:12:41 +0100
Message-ID: <36E52C59.3724@pcm.bosch.de>


Hello Cindy,

u could try this:

select a.account_nr, a.dollars, d.row_count   from your_table a,

       (select b.rowid inner_id ,count(*) row_count
          from your_table b, your_table c
         where b.rowid >= c.rowid
           and b.account_nr = c.account_nr
         group by b.rowid) d

 where a.rowid = d.inner_id;

HTH Angelito.

cindyclayton_at_att.com wrote:
>
> I am going to pull multiple rows of data for each account_nr. What I need to
> do is also bring a row number but I need to reset this for each account_nr
> group. For example..
>
> account_nr dollars Row
> 0000123 $100.00 1
> 0000123 $150.00 2
>
> 0000456 $200.00 1
> 0000456 $250.00 2
> 0000456 $350.00 3
> 0000456 $ 75.00 4
>
> 0000789 $225.00 1
>
> etc...
>
> Help will be appreciated!
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Tue Mar 09 1999 - 08:12:41 CST

Original text of this message

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