30_city.sql 634 B

1234567891011121314151617181920212223242526
  1. --30、单载频载扇用户数
  2. ---地市
  3. select
  4. month_id as MONTH_ID,
  5. '地市' as ZB_TYPE,
  6. '河北' as PROV_NAME,
  7. city_code*100 as CITY_ID,
  8. city_name as CITY_NAME,
  9. null as GRID_ID,
  10. null as GRID_NAME,
  11. '30' as ZB_CODE,
  12. '单载频载扇用户数' as ZB_NAME,
  13. '否' as IS_RATIO,
  14. total_user_yw as QZ_FZ,
  15. zps_total_with5g as QZ_FM,
  16. per_zps_user as BY_QZ
  17. from
  18. (select month_id,city_name,
  19. total_user_yw,zps_total_with5g,
  20. round(total_user_yw/zps_total_with5g) as per_zps_user
  21. from sqmdb_cost.jt_number_city jnc
  22. where month_id='202206') a
  23. join
  24. (select distinct city_code,city_sname from sqmdb_cost.dict_grid) dg
  25. on a.city_name=dg.city_sname
  26. order by dg.city_code