If the gold rate is changed then only we have to create a new row.
Input:
| dt |
Rate |
| 18-09-2014 |
27000 |
| 19-09-2014 |
27000 |
| 20-09-2014 |
31000 |
| 21-09-2014 |
31000 |
| 22-09-2014 |
31000 |
| 23-09-2014 |
32000 |
| 24-09-2014 |
31000 |
| 25-09-2014 |
32000 |
| 26-09-2014 |
27000 |
Output:
| StartDate |
EndDate |
Rate |
| 18-09-2014 |
19-09-2014 |
27000 |
| 20-09-2014 |
22-09-2014 |
31000 |
| 23-09-2014 |
23-09-2014 |
32000 |
| 24-09-2014 |
24-09-2014 |
31000 |
| 25-09-2014 |
25-09-2014 |
32000 |
| 26-09-2014 |
26-09-2014 |
27000 |