Reset Sequence number
Posted: Wed Sep 15, 2010 12:31 pm
Hi
I have incoming data as
Account Customer
----------- -------------
1 A
1 B
1 C
1 D
2 E
2 F
5 W
5 V
5 L
5 I
5 P
I want the sequence to be generated as
Account Customer seq
----------- ------------- ----------
1 A 1
1 B 2
1 C 3
1 D 4
2 E 1
2 F 2
5 W 1
5 V 2
5 L 3
5 I 4
5 P 5
That means.. for every new account number, it has to reset back to 1 and then increment it by one for every similar account number.
Note : the data is not sorted in the above order
Could you'll please help me on this ..
Thanks in anticipation.
I have incoming data as
Account Customer
----------- -------------
1 A
1 B
1 C
1 D
2 E
2 F
5 W
5 V
5 L
5 I
5 P
I want the sequence to be generated as
Account Customer seq
----------- ------------- ----------
1 A 1
1 B 2
1 C 3
1 D 4
2 E 1
2 F 2
5 W 1
5 V 2
5 L 3
5 I 4
5 P 5
That means.. for every new account number, it has to reset back to 1 and then increment it by one for every similar account number.
Note : the data is not sorted in the above order
Could you'll please help me on this ..
Thanks in anticipation.