By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
12 rows affected
prdt_no | order_date | quantity | unit_price | last_unit_price_before | last_unit_price_change_date | unit_price_diff |
---|---|---|---|---|---|---|
A001 | 01/02/2020 00:00:00 | 100 | 20 | 10 | 10/01/2020 00:00:00 | 10 |
A001 | 05/02/2020 00:00:00 | 100 | 20 | 10 | 10/01/2020 00:00:00 | 10 |
A001 | 07/02/2020 00:00:00 | 100 | 20 | 10 | 10/01/2020 00:00:00 | 10 |
A001 | 10/02/2020 00:00:00 | 100 | 15 | 20 | 07/02/2020 00:00:00 | -5 |
A002 | 01/02/2020 00:00:00 | 100 | 20 | 10 | 10/01/2020 00:00:00 | 10 |
A002 | 05/02/2020 00:00:00 | 100 | 20 | 10 | 10/01/2020 00:00:00 | 10 |
A002 | 07/02/2020 00:00:00 | 100 | 20 | 10 | 10/01/2020 00:00:00 | 10 |
A002 | 10/02/2020 00:00:00 | 100 | 15 | 20 | 07/02/2020 00:00:00 | -5 |