31_city.sql 530 B

1234567891011121314151617181920212223
  1. --31、宽带用户光衰质差率
  2. ---地市
  3. select
  4. k.smonth as MONTH_ID,
  5. '地市' as ZB_TYPE,
  6. '河北' as PROV_NAME,
  7. dg.city_code*100 as CITY_ID,
  8. trim(k.city_name) as CITY_NAME,
  9. null as GRID_ID,
  10. null as GRID_NAME,
  11. '31' as ZB_CODE,
  12. '宽带用户光衰质差率' as ZB_NAME,
  13. '是' as IS_RATIO,
  14. k.low_27 as QZ_FZ,
  15. k.onu_all as QZ_FM,
  16. k.low_27/k.onu_all as BY_QZ
  17. from sqmdb_cost.kd_low_quality k
  18. join
  19. (select distinct city_code,city_sname from sqmdb_cost.dict_grid) dg
  20. on trim(k.city_name)=trim(dg.city_sname)
  21. where k.smonth='202206'
  22. order by dg.city_code