select * from (
& |1 B/ I$ l8 x0 M" b) Xselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area
6 M4 o* g2 P, V% B8 Afrom admissions_data_info 2 O X% J" l! ^2 e0 z# j$ _. `+ y
group by business_year,area$ g m) g/ S" h/ r9 ~( p
union all, S( V# t4 X7 x) E2 r6 Y# G
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area. B) }. {* O" F7 Q5 h' _* A
from admissions_data_info
! \4 @% f' _2 P+ o4 Rgroup by business_year,area! G( C% K2 y* ^; t% l
union all
6 F5 u/ s! l4 I: X# K0 Jselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area# G+ N. y% u# r( b/ U
from admissions_data_info
5 z* F$ L( J0 x6 R9 Rgroup by business_year; n6 o% V5 H1 `5 V/ y
union all
9 j8 m( b! U2 {7 uselect business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area
( P+ M6 E/ \" F. N. B9 \' |2 Cfrom admissions_data_info
7 X+ C: f" s3 n" Q! \/ d0 Vgroup by business_year$ T7 u. j+ X) d" L% [ s4 \
)a
! ^9 p: Y# p4 h( }3 cwhere area=:area
) e1 ^' c4 e: A! |/ r% qorder by x |