SQL查询库存语句

select a.id1,b.snum2-a.snum1
from (select exdeGoodsID as id1,sum(exdeQuantity)as snum1 from ExdertDetail group by exdeGoodsID) as a
full JOIN (select imdeGoodsId as id2,sum(imdeQuantity) as snum2 from importDetail group by imdeGoodsID) as b on a.id1=b.id2
posted @ 2011-08-11 17:48  风一样的大叔  阅读(589)  评论(0编辑  收藏  举报