原帖由 lq810425 于 2006-4-11 10:06 发表
select a.mc,a.s1-b.q_out
from aaa a,(
select mc ,sum(s1) as q_out
from bb group by mc
)b
where a.mc=b.mc
原帖由 yjshen 于 2006-4-14 21:49 发表
select a.mc,a.s1-b.q_out
from AAA as a,(
select mc ,sum(s1) as q_out
from BBB group by mc
)as b
where a.mc=b.mc
这样写了是不是好理解点!
a.s1-b.q_out的意思是把库存减去出库!
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) | Powered by Discuz! X3.2 |