select * from ( N+ A6 S1 e P% x3 i3 k
select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area
) n: T6 s* u+ Q- l. p% v( Nfrom admissions_data_info ) S E" g8 Y% g5 W3 y K1 k
group by business_year,area
( M/ H, d( ^2 m5 |2 ?$ cunion all; w+ t8 I* p' A' `$ T
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area6 \9 z2 ^) O- S3 q6 y
from admissions_data_info
+ S) h4 S2 D) L. j" w3 Agroup by business_year,area
; x: F: p9 c0 |1 v* h$ runion all
4 C: z$ t& m! i4 C& E8 z# Qselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area
& H& M& _! `" \! G( c: y% hfrom admissions_data_info ' w3 Q7 B/ F. m" m2 m( ~1 S
group by business_year2 f* X# k7 l0 m
union all
6 p" t. d6 p1 V5 M }select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area* t# T( K: w& X. r6 o$ K
from admissions_data_info
3 d) z+ P8 _- m* U5 Ggroup by business_year
# v! J# s$ Y, A( q* i" i# R6 n)a* \) J" U7 c% N! x) B7 O( S
where area=:area6 q' E" |. I1 A5 c7 x; a
order by x |