By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
InventoryID | InventoryDate | Quantity | BBD | ItemID | MoneyValuePerUnit | incomeQuantity | balance |
---|---|---|---|---|---|---|---|
1 | 2019-12-01 16:23:39 | 100.0000 | null | 1 | 1.2300 | 100.0000 | 100.0000 |
2 | 2019-12-02 16:27:11 | 200.0000 | null | 1 | 1.5500 | 300.0000 | 300.0000 |
3 | 2019-12-03 16:31:58 | 100.0000 | null | 1 | 1.2300 | 400.0000 | 400.0000 |
4 | 2019-12-10 16:23:39 | -100.0000 | null | 1 | 1.2300 | 400.0000 | 300.0000 |
5 | 2019-12-11 16:23:39 | -137.0000 | null | 1 | 1.5500 | 400.0000 | 163.0000 |
6 | 2019-12-12 16:23:39 | 100.0000 | null | 1 | 1.6000 | 500.0000 | 263.0000 |
7 | 2019-12-13 16:23:39 | 250.0000 | null | 1 | 1.6000 | 750.0000 | 513.0000 |
8 | 2019-12-14 16:23:39 | -63.0000 | null | 1 | 1.5500 | 750.0000 | 450.0000 |
9 | 2019-12-15 16:23:39 | -40.0000 | null | 1 | 1.5500 | 890.0000 | 550.0000 |
10 | 2019-12-15 16:23:39 | 140.0000 | null | 1 | 1.6500 | 890.0000 | 550.0000 |
ItemID | spent |
---|---|
1 | 340.0000 |
InventoryID | InventoryDate | Quantity | ItemID | MoneyValuePerUnit | expense |
---|---|---|---|---|---|
3 | 2019-12-03 16:31:58 | 100.0000 | 1 | 1.2300 | 60.0000 |
6 | 2019-12-12 16:23:39 | 100.0000 | 1 | 1.6000 | 100.0000 |
7 | 2019-12-13 16:23:39 | 250.0000 | 1 | 1.6000 | 120.0000 |
10 | 2019-12-15 16:23:39 | 140.0000 | 1 | 1.6500 | 0.0000 |