select proj,sum(d) as 销售收入,sum(j) as 销售成本,sum(sl) as 销售数量
from
(
select * from z_pz01 where kmdm like '504%'
union all
select * from z_pz02 where kmdm like '504%'
union all
select * from z_pz03 where kmdm like '504%'
union all
select * from z_pz04 where kmdm like '504%'
)t
group by proj
from
(
select * from z_pz01 where kmdm like '504%'
union all
select * from z_pz02 where kmdm like '504%'
union all
select * from z_pz03 where kmdm like '504%'
union all
select * from z_pz04 where kmdm like '504%'
)t
group by proj
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货