chengben_center_city.sql 552 B

1234567891011121314151617
  1. --中间屏 分地市预算进度
  2. --chengben_center_city_202203.csv
  3. select
  4. cs.smonth,
  5. dg.city_sname as city_name,
  6. cs.cost_total as total_cost,
  7. ys.total_ys,
  8. cs.cost_total/ys.total_ys as rate_ys,
  9. dg.city_code*100 as city_code
  10. from
  11. (select smonth,sname,cost_total from sqmdb_cost.chengben_shengnei where stype='地市' and smonth='202204') cs
  12. join
  13. (select city_name||'_河北' as city_name,total_ys from sqmdb_cost.yusuan_shengnei) ys
  14. on cs.sname=ys.city_name
  15. join
  16. (select distinct city_code,city_pro,city_sname from sqmdb_cost.dict_grid) dg
  17. on cs.sname=dg.city_pro