06_b10.sql 775 B

123456789101112131415161718192021222324
  1. --06、百元资产网运成本(省内口径)
  2. ---北10
  3. select
  4. a.smonth as MONTH_ID,
  5. '北10' as ZB_TYPE,
  6. a.sname as PROV_NAME,
  7. null as CITY_ID,
  8. null as CITY_NAME,
  9. null as GRID_ID,
  10. null as GRID_NAME,
  11. '6' as ZB_CODE,
  12. '百元资产网运成本(省内口径)' as ZB_NAME,
  13. '否' as IS_RATIO,
  14. a.cost_total as QZ_FZ,
  15. b.zichan as QZ_FM,
  16. a.cost_total/b.zichan*100 as BY_QZ
  17. from
  18. (select smonth,stype,sname,cost_total as cost_total from sqmdb_cost.chengben_shengnei
  19. where stype='北10' and smonth='202206') a
  20. join
  21. (select sname,stype,sum(column7+column8)/2 as zichan from sqmdb_cost.report80054
  22. where sname in('北京','天津','河北','山西','内蒙古','辽宁','吉林','黑龙江','山东','河南')
  23. and stype='分省展现' and period_type='M' and smonth between '202201' and '202206' group by sname,stype) b
  24. on a.sname=b.sname