select * from (, L1 m7 [5 f+ `7 p% E5 s) W; `& y
select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area+ x. }" P4 [$ W: [- m; W
from admissions_data_info
[) {' H& k9 N8 I s7 ]9 ~$ l kgroup by business_year,area
# r# a6 P% Q* P& x: b6 I- ]( cunion all
. g/ a+ o$ j E( G& r9 l2 V% y) oselect business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area, F& c9 g% i: _7 T: {' p2 |+ y
from admissions_data_info
5 K" t% I7 B8 P/ c/ v* Ugroup by business_year,area+ z8 V" M3 i; C) U$ w9 Q
union all- a- d/ o5 k9 L2 o
select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area
9 _5 ^$ A9 e6 _( p( sfrom admissions_data_info
/ S$ ?6 b/ G6 Q$ s& @9 Y. ygroup by business_year0 ?# z1 t( `! X2 t! f0 U5 h
union all! s0 Q, }9 O! }
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area
* K: H8 g0 Y- L1 u7 bfrom admissions_data_info- P* a* A" g* g
group by business_year
2 p M8 ?2 s7 |)a
, K" Z _. X* W& ]1 C \& rwhere area=:area& v' Y6 j/ k, X3 }$ m" b
order by x |