By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
8 rows affected
| itemid | dt | qty |
|---|---|---|
| A001 | 2023-01-01 | 7 |
| A001 | 2023-01-02 | 7 |
| A001 | 2023-01-03 | 11 |
| A001 | 2023-01-04 | 11 |
| A001 | 2023-01-05 | 11 |
| A001 | 2023-01-06 | 11 |
| A002 | 2023-01-01 | 1 |
| A002 | 2023-01-02 | 4 |
| A002 | 2023-01-03 | 4 |
| A002 | 2023-01-04 | 4 |
| A002 | 2023-01-05 | 6 |
| A002 | 2023-01-06 | 5 |
Warning: Null value is eliminated by an aggregate or other SET operation.