123456789101112131415161718192021 |
- ---1-b.铁塔独享站成本占比
- ---chengben_quzhun_1_b_grid_202203.csv
- ----网格
- select
- t1.*,
- t2.city_code*100 as city_code,
- t3.area_code
- from
- (select sdate,city_operator,area_operator,
- sum(total_cost) as cost_total,
- sum(case when is_duxiang='独享' then total_cost else 0 end) as cost_du,
- sum(case when is_duxiang='独享' then total_cost else 0 end)/sum(total_cost) as cost_du_rate
- from sqmdb_cost.tower2 where sdate='202204'
- group by sdate,city_operator,area_operator) t1
- left join
- (select distinct city_code,city_name from sqmdb_cost.dict_grid) t2
- on t1.city_operator=t2.city_name
- left join
- (select distinct city_code,city_name,area_code,area_tower from sqmdb_cost.dict_grid) t3
- on t1.city_operator=t3.city_name and t1.area_operator=t3.area_tower
- order by t2.city_code,t3.area_code
|