select * from (
- X. i5 M' B; X8 h9 K& X& A, Nselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area
! i2 v; C7 c: S4 j$ L. o" Cfrom admissions_data_info
. L1 q4 j9 A# B& ~2 \group by business_year,area
: q# M7 `8 g& R4 v6 c; C0 kunion all2 S9 T1 E+ i2 R( n( c
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area
+ N0 d% J9 b! Q* Q1 L Yfrom admissions_data_info* L0 u; H) G# A# _ I
group by business_year,area( I }% z' \; k* _' O
union all
6 w( n; P/ L1 ?3 u/ ~* p0 }/ [ Eselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area
+ c O, y. i, l) |from admissions_data_info
" G% M& v+ @6 H/ B: D" Z- M. ?+ X5 J9 \group by business_year
8 s2 V3 N9 g1 Uunion all
& u+ S/ G' ]: uselect business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area
, g _1 M* Q7 g; Jfrom admissions_data_info ~- j e& e1 C
group by business_year$ F4 u( F3 W" ?/ v6 a% m, _: m* q
)a
& I9 g. y, r8 E, J+ X& q/ Twhere area=:area4 R+ s3 c' p; }4 E+ N
order by x |