Hello everyone,
I have scenario, in which I need to group set of data from table based on ID, price , quantity and if the start date between the records is successive)
In the below mentioned record, I need find if ID, quantity and price is matching between successive records months records and get the sum of amount.
ID | Start Date | End Date | quantity | price | Amount |
2 | 01/01/13 | 01/31/13 | 4 | 10000 | 31000 |
2 | 02/01/13 | 02/28/13 | 4 | 10000 | 28000 |
2 | 03/01/13 | 03/31/13 | 6 | 10000 | 31000 |
2 | 04/01/13 | 04/30/13 | 4 | 10000 | 31000 |