SQLサーバーに次のような一連のデータがあります。
ID ID_Invoice Article Quantity Status
1 10 carrot 10 null
2 10 carrot 5 C
3 10 onion 8 null
4 10 onion 4 C
5 11 tomato 20 null
6 11 tomato 18 C
7 11 onion 2 null
8 11 onion 1 C
これは、顧客が (1 つの請求書で) 10 個のニンジンと 8 個のタマネギを注文したが、実際には 5 個のニンジンと 4 個のタマネギしか受け取っていないことを意味します。ステータスがNULLの場合は元の数量、ステータスがCの場合は訂正済数量です
次のようなテーブルを生成する必要があります
ID ID_Invoice Article Quantity
1 10 carrot -5
2 10 onion -4
3 11 tomato -2
4 11 onion -1
各請求書の注文数量と実際の数量の差を示します。どうやって始めたらいいのかわからない。どんな助けでも深く感謝します:)