SELECT c.xitongshijian,sum(c.zongyeji) FROM count_report c group by c.xitongshijian;
根据count_report的时间分组统计总业绩,然后根据count_report的时间再查询统计另一张表的总业绩。
写完了
select t1.xitongshijian,t1.zyj,t2.xf from (SELECT xitongshijian,sum(zongyeji) as zyj FROM count_report group by xitongshijian )
t1 left join (select xitongshijian,sum(xiaofei) as xf from shangwutong group by xitongshijian) t2 on t1.xitongshijian=t2.xitongshijian
蛊毒传说
相关分类