Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Suppose we are having a sales file with columns amount, amount_paid_date and last_paid_date. We have to update the last_paid_date column with the previous value of amount_paid_date when the amount is zero, else the same corresponding date of amount_paid_date should be displayed in the last_paid_date.
| Id |
Amount |
Amount_paid_at |
Last_paid_date |
| 1 |
100 |
03-02-2018 |
03-02-2018 |
| 2 |
0 |
Null |
03-02-2018 |
| 3 |
0 |
Null |
03-02-2018 |
| 4 |
250 |
05-12-2018 |
05-12-2018 |
| 5 |
300 |
09-01-2019 |
09-01-2019 |
| 6 |
0 |
Null |
09-01-2019 |