By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| custid | Quantity | Price | ReportDate | id | startdate | discount | RN |
|---|---|---|---|---|---|---|---|
| 270723 | 12.00 | 1.2500 | 01/05/2014 00:00:00 | 2 | 10/01/2014 00:00:00 | 0.2500 | 1 |
| 270723 | 10.86 | 1.2500 | 01/06/2014 00:00:00 | 2 | 10/01/2014 00:00:00 | 0.2500 | 1 |
| 270723 | 12.29 | 1.3000 | 01/07/2014 00:00:00 | 2 | 10/01/2014 00:00:00 | 0.2500 | 1 |
| 270723 | 12.29 | 1.4000 | 15/09/2016 00:00:00 | 4 | 14/09/2016 00:00:00 | 0.1200 | 1 |
| 371965 | 12.00 | 2.0000 | 01/09/2016 00:00:00 | 3 | 11/07/2016 00:00:00 | 0.1100 | 1 |
| 371965 | 2.00 | 5.0000 | 25/02/2018 00:00:00 | 7 | 28/06/2017 00:00:00 | 0.0900 | 1 |
| 377958 | 45.00 | 3.0000 | 01/09/2016 00:00:00 | 3 | 11/07/2016 00:00:00 | 0.1100 | 1 |