By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
PO | Qty | INV | Quantity | total |
---|---|---|---|---|
A123 | 500 | IV100 | 100 | 400 |
A123 | 500 | IV105 | 200 | 200 |
A123 | 500 | IV112 | 200 | 0 |
B123 | 200 | IV102 | 10 | 190 |
B123 | 200 | IV106 | 190 | 0 |