select * from (% Y& u4 s! J# h0 H3 u
select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area
3 ?4 T/ g8 n* H n _from admissions_data_info
1 E# X. l! b6 S! e' Q0 Wgroup by business_year,area2 k/ Q& d0 `( D8 ?+ r
union all0 k: F" @7 Y" b- h5 }
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area
# t8 i: v, e* h. Kfrom admissions_data_info
, U9 k% s/ o% r' F% Y {group by business_year,area
2 g8 z7 ]8 e: B; |union all
5 G% t; ]' H ^- ?9 }" h) @8 Bselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area( y: x J* J! w
from admissions_data_info ( L% x( ^/ s/ w2 c: r/ ]: j8 Z$ n" ^$ O8 V
group by business_year
) C$ M6 \# R7 l. a+ F, i. A1 Aunion all7 W9 x" j3 O6 f0 |1 @3 ^
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area
+ R0 Y- [, l b. u9 ?' }from admissions_data_info- b+ l9 S: @& e( L/ L
group by business_year" _9 s/ s; X1 H/ I' V3 R$ l
)a
) v. }( u, f! m) |! Twhere area=:area
" T$ f# ]0 C' @7 U) Y X! W) }* forder by x |