select * from (
R% X0 ~2 y# |; g# h* c/ n3 mselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area
$ y% R5 W) {5 E% P/ d& Vfrom admissions_data_info
( J: Q! J# X& C6 g u% p1 O- Vgroup by business_year,area
! H( P2 Z9 G5 F% _5 ]7 N4 q4 dunion all9 c0 R8 q9 F! ^! a( ^
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area/ H9 H7 R R$ g8 C8 p* o7 \
from admissions_data_info
! \" y# i4 R* i6 V* v+ zgroup by business_year,area. C# C5 j7 B- X6 g4 x% `
union all: F$ |1 t+ N3 u4 `) y1 l0 x
select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area
" z+ b3 i/ z: K1 vfrom admissions_data_info # w6 J. S2 Z: }
group by business_year
. n) `4 g3 c8 O% y+ ^. w/ B, |& g6 h: Bunion all: U1 C5 _# W1 r6 X4 y( R( m& _9 E
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area- m: T3 V- I+ ?0 ?, \5 Q) w
from admissions_data_info# R9 u+ y! F8 B9 c) ~' p' [, n4 k8 s
group by business_year% E+ f1 @0 m& a) n; s
)a F; r" \& q+ T6 _1 \) z# @
where area=:area h/ F$ Z2 ]1 O) x
order by x |