select * from (
9 m% Y$ N' L4 m, I8 e5 V# K( P3 Bselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area% g* j4 h1 t7 l' n( x2 I8 ~( z8 p+ x( b
from admissions_data_info
5 t k D" z8 Y- a: zgroup by business_year,area- T6 q2 l7 D; m7 H+ p, u
union all" B7 x+ [# Y9 w8 y
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area
9 W! T7 Y# a1 k" \& Wfrom admissions_data_info4 Z) W# `) S3 w6 _
group by business_year,area) t4 a% v! x2 t+ a D- y
union all
" g4 e6 @% H$ A6 U* U1 w9 Gselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area! u8 v+ ~& M) h- L; U0 R( S
from admissions_data_info : X* y1 M! Q$ E- h2 z
group by business_year
4 V! \$ t2 w2 v" A. Y: }9 T: m% lunion all2 ?/ |- }& e: G! n
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area
% z# I: D, l% Q4 b0 J3 ^* T/ }7 ^3 ofrom admissions_data_info9 x6 Q' p. d9 i1 N+ W) @- y
group by business_year1 [7 o. ~4 R" ?- V8 p; L
)a! K5 P( R$ \- D$ N H
where area=:area1 i0 s! B/ P$ t& A# p V% _$ H! s) n
order by x |