Hi everyone, can someone help me with this tricky T-SQL, This how it should work.
Material Qty Status
A - 100 - 0
A - 50 - 0
A - 200 - 1
A - 50 - 1
First I need to SUM all Status 1 and also SUM all Status 0 Then I need to find the difference of SUM of Status1 and SUM of Status0
Sum of Status 0
100+50 =150
Sum of Status 1
200+50 = 250
Difference
250-150=100
Final Output is:
Material Qty
A -100
I really need help on this one. Thanks in advance