By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
31 rows affected
| AccountId | BundleId | ProductsRemaining | ap | c |
|---|---|---|---|---|
| 1000 | 1 | 0 | 0 | 3 |
| 1001 | 1 | 3 | 0 | 6 |
| 1001 | 2 | 3 | 0 | 6 |
| 1002 | 2 | 0 | 0 | 3 |
| 1003 | 3 | 0 | 0 | 1 |
| 1004 | 3 | 2 | 0 | 3 |
Warning: Null value is eliminated by an aggregate or other SET operation.