select * from (
6 F+ a- P$ t( a' {% bselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area
& F. q, E" q6 V% g& f; d+ Hfrom admissions_data_info
6 j+ T9 S% @! \group by business_year,area
; p& m* Q; b. s9 `! s8 Sunion all$ |, U4 A! \6 q* }
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area
1 w/ f, e& O' R2 W9 zfrom admissions_data_info# ]( u' f7 N* }1 T" x
group by business_year,area
; t; m, Y( N3 ]% |# }, punion all
2 u* h# C% s, `4 W5 ^# h% kselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area
( }: T5 E0 P2 s0 l3 Sfrom admissions_data_info
0 a7 k, i9 f; q+ E9 S: ^4 o# rgroup by business_year; T X- Z7 B: P; h2 H8 H" ^
union all
0 F. l4 a; A# N$ c( _/ w. Y/ bselect business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area
5 |/ {! d7 T+ c! x% vfrom admissions_data_info, r0 o' \% s- x6 T% K
group by business_year
% K$ l5 \0 l% e2 {)a
3 X5 L4 m& N8 pwhere area=:area* ]' |8 j) D8 ^* V$ h( I* P% Q: w5 R
order by x |