select t.bm,
(select count(*) from a where a.zl1=1 and a.bm=t.bm group by a.bm) as zl1,
(select count(*) from a where a.zl1=2 and a.bm=t.bm group by a.bm) as zl1,
(select count(*) from b where b.bm=t.bm group by b.bm) as qtfrom a tclwyzx希望有所提示,有空到51cto,365testing进一步交流!...
select t.bm,
(select count(*) from a where a.zl1=1 and a.bm=t.bm group by a.bm) as zl1,
(select count(*) from a where a.zl1=2 and a.bm=t.bm group by a.bm) as zl1,...