Hi,
I have a table like this with two fields Field1,Field2.
Field 1 Field 2
00345 Hello world
00456 Hello world
09934 Hello world
78900 New filed
12345 New filed
24423 New filed
98778 How are you
12355 How are you
344545 How are you
22223 How are you
I have to add an extra field called ID which should generate a sequential number depending on Field2.
The out put should be like this:
ID Field 1 Field2
1 00345 Hello world
2 00456 Hello world
3 09934 Hello world
1 78900 New filed
2 12345 New filed
3 24423 New filed
1 98778 How are you
2 12355 How are you
3 344545 How are you
4 22223 How are you
I need to create a count and increase it depending on Field2. whenever field 2 changes I need to reset the count.
Could any body help me in writing a stored procedure for this.
TIA