123456789101112131415161718192021222324252627282930 |
- --18、单皮长公里线路维护费(月)
- ---地市
- select
- t1.smonth as MONTH_ID,
- '地市' as ZB_TYPE,
- '河北' as PROV_NAME,
- dg.city_code*100 as CITY_ID,
- t1.sname as CITY_NAME,
- null as GRID_ID,
- null as GRID_NAME,
- '18' as ZB_CODE,
- '单皮长公里线路维护费(月)' as ZB_NAME,
- '否' as IS_RATIO,
- t1.cost_xianlu as QZ_FZ,
- t2.total_gl as QZ_FM,
- t1.cost_xianlu/t2.total_gl/6 as BY_QZ
- from
- (select '202206' as smonth,sname,
- sum(column65+column66+column67+column68+column69)/10000 as cost_xianlu
- from sqmdb_cost.report50
- where sname in('石家庄_河北','唐山_河北','秦皇岛_河北','邯郸_河北','邢台_河北','保定_河北','张家口_河北','承德_河北','廊坊_河北','沧州_河北','衡水_河北','雄安_河北')
- and period_type='M' and smonth between '202201' and '202206' group by sname) t1
- join
- (select city_name||'_河北' as city_pro,total_gl
- from sqmdb_cost.jt_number_city where month_id='202206') t2
- on t1.sname=t2.city_pro
- join
- (select distinct city_code,city_pro from sqmdb_cost.dict_grid) dg
- on t1.sname=dg.city_pro
- order by dg.city_code
|