123456789101112131415161718192021222324252627282930 |
- --18、데튄낀무쟁窟쨌郭빱롤(墩)
- ---뒈懇
- select
- t1.smonth as MONTH_ID,
- '뒈懇' as ZB_TYPE,
- '붉굇' as PROV_NAME,
- dg.city_code*100 as CITY_ID,
- t1.sname as CITY_NAME,
- null as GRID_ID,
- null as GRID_NAME,
- '18' as ZB_CODE,
- '데튄낀무쟁窟쨌郭빱롤(墩)' as ZB_NAME,
- '뤠' as IS_RATIO,
- t1.cost_xianlu as QZ_FZ,
- t2.total_gl as QZ_FM,
- t1.cost_xianlu/t2.total_gl/6 as BY_QZ
- from
- (select '202206' as smonth,sname,
- sum(column65+column66+column67+column68+column69)/10000 as cost_xianlu
- from sqmdb_cost.report50
- where sname in('柯소鏤_붉굇','鉗�_붉굇','해뽈돎_붉굇','벳덱_붉굇','饉憩_붉굇','괏땍_붉굇','蠟소왯_붉굇','넓돠_붉굇','읜렌_붉굇','꾕鹵_붉굇','뷜彊_붉굇','衿갛_붉굇')
- and period_type='M' and smonth between '202201' and '202206' group by sname) t1
- join
- (select city_name||'_붉굇' as city_pro,total_gl
- from sqmdb_cost.jt_number_city where month_id='202206') t2
- on t1.sname=t2.city_pro
- join
- (select distinct city_code,city_pro from sqmdb_cost.dict_grid) dg
- on t1.sname=dg.city_pro
- order by dg.city_code
|