select * from (7 r8 X$ w9 Z2 n* _
select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area
# X7 G m3 [ t5 F/ rfrom admissions_data_info ; k2 P2 N( a) ?# Z3 q( q3 H
group by business_year,area
3 k( c6 L5 O4 }8 b; j* s8 Qunion all
% q) t3 x! ^! k* }2 x* e3 u2 sselect business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area
3 ~# F. O/ h+ A, S5 g: dfrom admissions_data_info# S. k+ j) r% |+ F6 O, g0 h
group by business_year,area# l* {& f! n. m6 O
union all* O6 n/ V) J& ?# u
select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area
) G" n, {! c! ]% |( L% {from admissions_data_info
. S5 z! v( G, Z; l2 Ggroup by business_year
. D2 J+ A* C6 N2 s# }union all$ p# Y. q" }7 G$ A; f
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area
( w8 i/ a# S+ G7 C( {. Efrom admissions_data_info
* R) [, l' E8 t. U* \: G6 egroup by business_year+ F% k" j4 c8 g9 }
)a5 g3 ]+ T2 G# V: w3 L7 i# N
where area=:area* W$ J4 k B0 g& F1 _1 X
order by x |