select * from (
: X2 g- g( r C% o; ]: G( Dselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area+ o$ g# z5 O2 {1 B7 l! t- r0 K! H
from admissions_data_info
4 `, l( R, W( E5 W" E# ygroup by business_year,area
/ r- n" E# l @union all
! g' T$ H' c. `& iselect business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area* `3 [7 B! a) Z# |. m" P) y
from admissions_data_info
$ i: o: M" T" a. M$ A2 |group by business_year,area* @) a P) j ]
union all; Q, ?: X* B, j8 z6 r& U
select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area- W$ e4 ^# M* Z9 k6 G0 D: G. O
from admissions_data_info
( Q2 G5 x* a) D! o1 L- wgroup by business_year/ | b" a( F/ s
union all( N. a& Z1 }) e' J1 `
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area
7 o) Y$ h7 y3 j! |: @) Q) @from admissions_data_info3 U3 y/ [! E% J' F
group by business_year7 X- ]4 g* Y+ L* z: r
)a; ~3 v: l9 P/ K) e2 n" S7 Q) Z v+ w0 C
where area=:area4 M( v! h5 v7 E: u' t- B/ F
order by x |