chengben_other_1_city_b10.sql 726 B

12345678910111213141516171819202122232425
  1. --02、网运成本占收比(省内口径)
  2. --chengben_other_1_city_b10_202203.csv
  3. select t1.*,
  4. case
  5. when sname='北京' then 110000
  6. when sname='天津' then 120000
  7. when sname='河北' then 130000
  8. when sname='山西' then 140000
  9. when sname='内蒙古' then 150000
  10. when sname='辽宁' then 210000
  11. when sname='吉林' then 220000
  12. when sname='黑龙江' then 230000
  13. when sname='山东' then 370000
  14. when sname='河南' then 410000
  15. else t2.city_code*100 end as city_code
  16. from
  17. (select smonth,stype,sname,cost_total,income,
  18. cost_total/income as cost_income_rate
  19. from sqmdb_cost.chengben_shengnei
  20. --where stype='北10'
  21. --where stype='地市'
  22. where smonth='202204') t1
  23. left join
  24. (select distinct city_code,city_pro from sqmdb_cost.dict_grid) t2
  25. on t1.sname=t2.city_pro