--04、网运成本预算完成进度(省内口径) select cs.smonth as MONTH_ID, '地市' as ZB_TYPE, '河北' as PROV_NAME, dg.city_code*100 as CITY_ID, dg.city_sname as CITY_NAME, null as GRID_ID, null as GRID_NAME, '4' as ZB_CODE, '网运成本预算完成进度(省内口径)' as ZB_NAME, '是' as IS_RATIO, cs.cost_total as QZ_FZ, ys.total_ys as QZ_FM, cs.cost_total/ys.total_ys as BY_QZ from (select smonth,sname,cost_total from sqmdb_cost.chengben_shengnei where stype='地市' and smonth='202207') cs join (select city_name||'_河北' as city_name,total_ys from sqmdb_cost.yusuan_shengnei) ys on cs.sname=ys.city_name join (select distinct city_code,city_pro,city_sname from sqmdb_cost.dict_grid) dg on cs.sname=dg.city_pro order by dg.city_code