select * from (
* A, p8 P7 B' D+ [select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area) t$ K& A8 g5 W4 J1 b( s- q g
from admissions_data_info
; G7 H3 c+ `# T |group by business_year,area
- C6 F+ q" ?) J n/ M* W2 u0 gunion all5 g2 W+ i5 X+ K/ Y; }# b2 A% m. O' X
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area
m: T' Z1 \* S& f* }2 ufrom admissions_data_info% W' b" a! S$ Q, f* F1 I" ]2 l
group by business_year,area
7 u3 g6 }0 I3 y. p8 A9 @union all
% `& [1 K; C2 W& @; S3 Y% L# l+ {select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area$ N. L( o5 L( m/ l0 w& M/ R
from admissions_data_info
2 @, d) E4 j& s5 U S) Ngroup by business_year
, ?+ V* E. q5 Punion all/ o$ ^/ k) y+ {* j! t# q
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area
* l7 I& ^( }( _* l7 g9 K. Dfrom admissions_data_info8 H [( T% W, e; a6 g
group by business_year$ P8 ^* j& z, x( d& d' g% e0 ~7 r' O
)a# q" ^* w& F& U. K( x9 d* ?0 L
where area=:area2 d q+ B) @, _8 _1 w
order by x |