-- 业务指标 : 订单量 ,因为 tbl_tabl没有提供商品销量 select t_1.city ,t_1.oder_num_20- t_2.oder_num_19)/t_2.oder_num_19 as dec_rank from -- 2020年第一季度(1-3月)全国各城市订单量 (select c.city -- 同比订单下滑量 (20 -19)/19 ,count b.oderid as oder_num_20 from tbl_table b left join tbl_user c on b.userid = a.userid where b.oderdata between ’2020-01-01‘ and ’2020-01-03‘ group by c.City ) as t_1 left join -- 2019 年第一季度(1-3月)全国各城市订单量 (select c.city ,count b.oderid as oder_num_19 from tbl_table b left join tbl_user c on b.userid = a.userid where b.oderdata between ’2019-01-01‘ and ’2019-01-03‘ group by c.City ) as t_2 on t_1.city = t_2.c.ty order by dec_ran 2.
selet b.Province ,(count a.orderid ) *2 as luntai_predicted_value from tbl_table a left join tbl_user b on a.userid=b.userid group by b.Province having a.orderdata = '2019-11-11' and a.catagory = 轮胎