22,209
社区成员
发帖
与我相关
我的任务
分享
select
b.pno,
sum(case c.status when '验收' then 1 else 0 end) as 数量
from
order a,订单子表 b,in c,进货子表 d
where
a.no=b.no
and
c.no=d.no
and
b.pno=d.pno
and
a.sno=c.sno
group by
b.pno
select
b.pno,
sum(case c.status when '验收' then 1 else 0 end) as 数量
from
order a,订单子表 b,in c,进货子表 d
where
a.no=b.no
and
c.no=d.no
and
b.pno=d.pno
and
a.no=c.no
group by
b.pno