By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
(No column name) |
---|
Microsoft SQL Server 2022 (RTM) - 16.0.1000.6 (X64) Oct 8 2022 05:58:25 Copyright (C) 2022 Microsoft Corporation Express Edition (64-bit) on Windows Server 2019 Standard 10.0 <X64> (Build 17763: ) (Hypervisor) |
id | Transaction | amount | inventory | price | average |
---|---|---|---|---|---|
1 | null | null | 11 | null | 90 |
2 | Sale | -1 | 10 | 100 | 90 |
3 | Purchase | 2 | 12 | 102 | 92 |
4 | Sale | -2 | 10 | 103 | 92 |