Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Numbers in Sequence
"Reiro" <ReiroGP_at_gmail.com> wrote in message
news:1158309880.511027.198200_at_b28g2000cwb.googlegroups.com...
> Hi ppl....
>
> i hav the foll: table in oracle... a sample table with just two columns
> will look lyk this:
>
> Name SEQ_number
> A 31
> A 33
> A 37
> B 2
> B 3
> B 6
> C 4
> C 7
> C 8
>
>
> the prob is that i need the numbers tfor each name to be in sequence
> starting from 1...
> to look lyk the foll:
>
>
> Name SEQ_number
> A 1
> A 2
> A 3
> B 1
> B 2
> B 3
> C 1
> C 2
> C 3
>
> Plzzz help...
> thx in advance :)
>
oops
a bit of pl sql would do the trick
1
select max seqnumber from x where name = y
then do the insert
2
use dif seq for each name
it's a bit hard to understand as you have not said the volumes involved Received on Fri Sep 15 2006 - 04:24:35 CDT
![]() |
![]() |