SQL Running Subtraction

前端 未结 3 752
一整个雨季
一整个雨季 2021-01-07 01:44

I have a result set as below:

Item    ExpectedQty  ReceivedQty  Short
Item01  30           45           5
Item01  20           45           5

Item02  40             


        
3条回答
  •  囚心锁ツ
    2021-01-07 02:30

    select a.Item, a.ExpectedQty,b.ReceivedQty, (a.ExpectedQty - b.ReceivedQty) as 'Short' from a join b on a.Item = b.Item
    

提交回复
热议问题