select * from (
3 j$ S1 v3 K( A7 e! fselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area) H; ^! k( J7 @
from admissions_data_info
! h; ~: N) t, ^( N+ Cgroup by business_year,area, I" Y1 k; V% \5 a+ H
union all1 i7 W) C( I! [5 Q
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area
v, c a! v" q8 V' Yfrom admissions_data_info
) n- b# M. h" J# Y6 U9 C$ Qgroup by business_year,area
2 i; G; ? L6 X, f5 p2 S9 h5 ^union all1 b8 c5 m, \; D7 ~: T: S
select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area
2 s `& E5 [* \7 U" Y2 z0 j" ffrom admissions_data_info 9 o1 Z# s! Z( l
group by business_year. b0 x" ?1 I, N6 e) O
union all
! n& Q) C y" X b* Q6 h/ G2 Oselect business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area2 Z) j0 @: k% m$ M" t: c, T3 U
from admissions_data_info/ W2 \: S; |/ J. F/ N. _
group by business_year) {7 [) }/ F! a5 s- ^) Z2 q7 m6 P
)a6 F! W- t9 f; x% V' [" w
where area=:area( J; b, i3 l4 e6 v+ o. ~
order by x |