select sum(b.money) ,biz_type,pay_type from a left join b on a.order_id = b.order_id  where a.time between '2020-02-01' and &(11308)#39;2020-02-15' and a.order_status=5  group by biz_type,pay_type select t1.a1) / t2.a2 from  (select count(1) as a1 from (select 1 from c group by order_id ) t1, (select count(1)  as a2 from a