12_city.sql 564 B

12345678910111213141516171819202122
  1. --12、单端口网运成本(月)
  2. ---地市
  3. select
  4. city.smonth as MONTH_ID,
  5. '地市' as ZB_TYPE,
  6. '河北' as PROV_NAME,
  7. dg.city_code*100 as CITY_ID,
  8. city.city_sname as CITY_NAME,
  9. null as GRID_ID,
  10. null as GRID_NAME,
  11. '12' as ZB_CODE,
  12. '单端口网运成本(月)' as ZB_NAME,
  13. '否' as IS_RATIO,
  14. city.cost_total as QZ_FZ,
  15. city.port_inuse as QZ_FM,
  16. city.cost_total/city.port_inuse/6 as BY_QZ
  17. from sqmdb_cost.rpt_dport_cost_city city
  18. left join
  19. (select distinct city_code,city_sname from sqmdb_cost.dict_grid) dg
  20. on city.city_sname=dg.city_sname
  21. where smonth='202206'
  22. order by dg.city_code