G
Guest
The following is the scenario
stock _ in table
Id item_no pcs
1 1 10
2 2 30
3 1 22
stock_out_table
Id item_no pcs
1 1 6
2 2 12
3 1 6
So the Query result should show or the Qty on hand should show this result.
ItemNum QOH
1 20
2 1
can you help me with an apt. query. I tried using
select t1.itemnum,sum(t1.pcs-t2.pcs)
from t1,t2 where t1.itemnum=t2.itemnum
group by t1.itemnum
but it did not work. any suggestions .
tHANKS IN ADVANCE.
stock _ in table
Id item_no pcs
1 1 10
2 2 30
3 1 22
stock_out_table
Id item_no pcs
1 1 6
2 2 12
3 1 6
So the Query result should show or the Qty on hand should show this result.
ItemNum QOH
1 20
2 1
can you help me with an apt. query. I tried using
select t1.itemnum,sum(t1.pcs-t2.pcs)
from t1,t2 where t1.itemnum=t2.itemnum
group by t1.itemnum
but it did not work. any suggestions .
tHANKS IN ADVANCE.