By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
5 rows affected
| ID | Amount | totalAmount | PO_ID | PO | Sequence | PO_Amount | totalPO_Amount | PO_Alloc_Amount | PO_Remaining_Amount |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 5000 | 5000 | 1 | PO1 | 1 | 2000 | 2000 | 2000 | 0 |
| 1 | 5000 | 5000 | 2 | PO2 | 2 | 4000 | 6000 | 3000 | 1000 |
| 2 | 3000 | 8000 | 2 | PO2 | 2 | 4000 | 6000 | 1000 | 0 |
| 3 | 4000 | 12000 | null | null | null | null | null | 4000 | null |