select v1.Value1 - v2.Value2
from (Select Amt as Value1
from lineitem
WHERE item ='test1' and type='receiving')
as v1 CROSS JOIN (Select Amt as Value2
from lineitem
WHERE item ='test1' and type='shipping')
as v2;
This script isn’t returning anything. What I’m trying to do is subtract the Amts on the same table from receiving and shipping. Any advice?
1 Answer