select * from (* Z* q8 P! w2 D' W, V
select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area7 _3 m) Y7 c. U: C7 e' z9 h( c1 j8 k
from admissions_data_info
( b' t9 @4 Y/ e' Qgroup by business_year,area
8 P1 \! S2 e, Y$ L! lunion all
1 w1 l2 w' [0 ? ~5 ~7 t- o: Eselect business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area
) J7 y. v0 m6 j! `' Zfrom admissions_data_info1 a8 b4 i# U( B+ ^/ z' R, ~7 ^
group by business_year,area' z) x% V5 p+ `2 v3 E. J8 g7 u
union all- \: c$ l! ~3 T
select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area+ J) I. n3 K$ i' e/ N
from admissions_data_info - s8 {9 w- |4 A/ A+ E1 V2 |
group by business_year
3 A& g6 \4 f) n& k: yunion all
' T) W: H% X. g, F/ dselect business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area
/ y- o* j6 S" v! wfrom admissions_data_info
4 B4 n H/ Q* d# bgroup by business_year
# a# U& J0 j" U4 S)a5 ]" ]4 C1 ?3 u+ Q/ X
where area=:area/ N3 M% |# A' Q2 x( m0 Y" X
order by x |