select * from (8 }% v& w# @7 w# c% G
select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area: g* D% C1 m0 H+ Q4 C1 ]5 a0 ?$ b
from admissions_data_info 4 d9 e, P- g- ~1 u! S
group by business_year,area' ^7 {6 \% G# w; ~( h6 y
union all
/ p5 z6 {/ U$ x1 `, k( jselect business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area: k0 V2 s" i) h. ]/ C
from admissions_data_info
' Q& r& H) q0 A) ]! S( Pgroup by business_year,area
: e4 ~4 r7 v9 f1 Nunion all3 C2 a6 I0 e. l
select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area0 I) u3 E& f7 }9 D
from admissions_data_info
; z; j" C. Q9 ^( A3 Wgroup by business_year
) t$ d+ O/ c2 f0 X# o, [% M) }, R( p6 Uunion all
, M% L. W- o% ]6 q: V3 C1 Vselect business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area
: H' Z$ I+ ?( |& r; j6 |& t% [from admissions_data_info
! y( q7 S: {: p5 _: X3 Zgroup by business_year
1 Q0 N% f9 Z0 j, x& D/ n" p)a2 r+ H2 Y9 B+ r
where area=:area7 y' c) E* N* v, T0 T
order by x |