一
一少
Unregistered / Unconfirmed
GUEST, unregistred user!
ACCESS数据库
配件表(pj)
pjid
pjname (配件名)
进货表(stock)
id
pjid
stockcount (进货数)
售出表 (sell)
id
pjid
sellcount 售出 数
我是这样写的,行不通,哪个朋友指点一下,就这么点分了,不够的话有了再送上
SELECT pj.pjname, sum(stock.stockcount)-sum(sell.sellcount)
FROM (stock INNER JOIN sell ON sell.pjid = stock.pjid) inner join pj on pj.pjid=stock.pjid
GROUP BY stock.pjid;
配件表(pj)
pjid
pjname (配件名)
进货表(stock)
id
pjid
stockcount (进货数)
售出表 (sell)
id
pjid
sellcount 售出 数
我是这样写的,行不通,哪个朋友指点一下,就这么点分了,不够的话有了再送上
SELECT pj.pjname, sum(stock.stockcount)-sum(sell.sellcount)
FROM (stock INNER JOIN sell ON sell.pjid = stock.pjid) inner join pj on pj.pjid=stock.pjid
GROUP BY stock.pjid;