我有两个疑问:
str = "select sum(Quantity) from AddStock where ProductId=" +id.ToString() + " AND Type IN('Purchase','StockInward','Sale Return') AND EntryMode='Godown'";
Qty = dc.Retrieve_Datareader(str);
str = "select sum(Quantity) from AddStock where ProductId=" +id.ToString() + " AND Type IN('StockOutward','Sale','Wastage','Purchase Return') AND EntryMode='Godown'";
Qty1 = dc.Retrieve_Datareader(str);
return(Qty - Qty1);
如何在一个查询中编写上述两个查询并获得差异?