10_city.sql 641 B

12345678910111213141516171819202122232425
  1. --10、修理维护费占收比(省内口径)
  2. select
  3. cs.smonth as MONTH_ID,
  4. '地市' as ZB_TYPE,
  5. '河北' as PROV_NAME,
  6. dg.city_code*100 as CITY_ID,
  7. cs.sname as CITY_NAME,
  8. null as GRID_ID,
  9. null as GRID_NAME,
  10. '10' as ZB_CODE,
  11. '修理维护费占收比(省内口径)' as ZB_NAME,
  12. '是' as IS_RATIO,
  13. cs.cost_fix as QZ_FZ,
  14. r.column4 as QZ_FM,
  15. cs.cost_fix/r.column4 as BY_QZ
  16. from sqmdb_cost.chengben_shengnei cs
  17. join sqmdb_cost.report80040 r on cs.smonth=r.smonth and cs.sname=r.sname
  18. join
  19. (select distinct city_code,city_pro from sqmdb_cost.dict_grid) dg
  20. on cs.sname=dg.city_pro
  21. where r.period_type='M'
  22. and cs.stype='地市'
  23. and cs.smonth='202206'
  24. order by dg.city_code