select * from (# m0 C3 l! L* q+ H5 w+ w
select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area9 R2 Z( K/ J3 P* \
from admissions_data_info
# _7 V$ b) n0 p6 \9 ], T1 |group by business_year,area
7 p& b2 ^7 u% bunion all
5 G x$ P2 }: z) @select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area( i- B6 |& e: b x2 }& [
from admissions_data_info
& r- ~4 d @1 I+ U) C0 v( z$ d$ B8 pgroup by business_year,area- O7 t9 {. ], O- G- t8 a1 \
union all6 K' D0 u$ y& }2 X
select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area: g6 K3 F. t. H) \8 f" {8 \& J
from admissions_data_info
9 N$ @. t$ L5 fgroup by business_year$ n0 c% j J1 _
union all+ g! y% l6 ~) `: E' f$ t4 Z
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area
! v$ }7 L- o$ ~3 q7 ufrom admissions_data_info1 {: G* d6 g" N1 u/ B I2 `
group by business_year
0 L# }' x: g8 u: S+ k6 r; J$ W)a1 g! r7 B3 r) {4 q6 Z
where area=:area; M5 }7 _" S. O+ H( I
order by x |