Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Row Numbers
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
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
![]() |
![]() |