--02、网运成本占收比(省内口径) select cs.smonth as MONTH_ID, '地市' as ZB_TYPE, '河北' as PROV_NAME, dg.city_code*100 as CITY_ID, cs.sname as CITY_NAME, null as GRID_ID, null as GRID_NAME, '2' as ZB_CODE, '网运成本占收比(省内口径)' as ZB_NAME, '是' as IS_RATIO, cs.cost_total as QZ_FZ, r.column4 as QZ_FM, cs.cost_total/r.column4 as BY_QZ from sqmdb_cost.chengben_shengnei cs join sqmdb_cost.report80040 r on cs.smonth=r.smonth and cs.sname=r.sname join (select distinct city_code,city_pro from sqmdb_cost.dict_grid) dg on cs.sname=dg.city_pro where r.period_type='M' and cs.stype='地市' and cs.smonth='202207' order by dg.city_code