How to assign sequence numbers to sorted data ?
Posted: Mon Mar 05, 2007 3:08 am
Hi.
I have this data which at present has sequence numbers which are not in order due to some data records failing to migrate to target due to validation failure, and later on passing through after being suitably corrected.
Now I first of all sort the data on the basis of a key and the timestamp of the creation of the data record to get a proper logical sequence.
Now, how can I assign the appropriate sequence numbers to each record, considering that for a given key, there can be multiple data, and I am grouping the data on the basis of the key value.
So if I have key value as A, and corresponding records as 4 in number, so they should be logically numbered as 1-4, and for another key value B with corresponding records as 5 in number, the logical numbering should be 1-5.
Considering that both groups of records are in the same dataset, can anyone suggest as to how I can achieve this logical numbering?
I have this data which at present has sequence numbers which are not in order due to some data records failing to migrate to target due to validation failure, and later on passing through after being suitably corrected.
Now I first of all sort the data on the basis of a key and the timestamp of the creation of the data record to get a proper logical sequence.
Now, how can I assign the appropriate sequence numbers to each record, considering that for a given key, there can be multiple data, and I am grouping the data on the basis of the key value.
So if I have key value as A, and corresponding records as 4 in number, so they should be logically numbered as 1-4, and for another key value B with corresponding records as 5 in number, the logical numbering should be 1-5.
Considering that both groups of records are in the same dataset, can anyone suggest as to how I can achieve this logical numbering?