select * from (
# X1 c; n4 D. g% `; h& u) a! ^- Yselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area/ _. {' H6 ]( H$ v! A( ]# h. o
from admissions_data_info . v1 w& o F. V! K; Q
group by business_year,area0 X y( g1 f6 F& N+ Z. s0 p3 ~8 [
union all% W" D$ I |3 _
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area" o8 `9 v" B& Z. Z& u6 h9 d
from admissions_data_info M* Q u$ ~% h- P
group by business_year,area l% P/ g5 \4 n5 p, x0 P0 A( U, w
union all" m1 D4 k& G1 s& D; Y
select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area
8 f( e- g7 v* n6 s7 m# B7 _: Efrom admissions_data_info
8 }9 o( @5 B+ L, D; t8 a; P9 r7 agroup by business_year
3 O$ b) D' \7 q' ]/ gunion all; l5 M$ y0 x9 k8 i
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area
4 K" | r1 J; ] @) ~* Dfrom admissions_data_info) g) W4 m8 _( ]5 l( p) F1 ~, a) W
group by business_year
/ w8 s6 o- g+ o ^: l)a
! t9 L2 x6 _* Z" i0 Twhere area=:area* j8 s, `$ A4 m! r# f ]/ E, H
order by x |