I want to generate the TransactionNo which is it start from 0000000020 by ID. If there have the same ID, the TransactionNo will keep adding 20. On the other hand, it there have different ID, the TransactionNo will start again from 0000000020. Any idea for the scripting?
The following is the example table for the scenario above:
Thanks for reply. To repeat the loop is based on the ID.
Note: The number of repeat the ID is based on the transactions data. It is not fix. It may be can 4 transaction for ID (00001), 2 transaction for ID (00002) and so on.
For example, it there have 4 transactions for ID (00001), then we need to create 4 transactionNo start from 0000000020 and keep adding 20 for the subsequent which fall under ID is 00001. Next, there have 2 transactions for ID(00002), so we need to create 2 transactionNo again start from 0000000020 and keep adding 20 for the subsequent which fall under ID is 00002. The following ID (00003,00004....) are keep repeat the steps above.