select * from (
7 O% G% T1 ^* I( ~7 z6 Mselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area
1 V6 L- c& m4 b6 b5 qfrom admissions_data_info
) O/ W9 ]5 |+ z1 s- Ngroup by business_year,area
$ I6 c0 A; O8 ~2 A# Y) y. Aunion all# ?; u7 c2 r4 I B g1 v
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area! Q& \5 r: _& }. y, t5 u" H
from admissions_data_info4 f- q; m1 d$ K: N4 `) r
group by business_year,area
$ O+ ?/ [$ Y! J. nunion all! {3 G7 u, f% B; V0 s! @; b7 P
select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area
! c; A8 D& ]- \6 z Zfrom admissions_data_info $ ]( }8 T" G' K0 Y& J! `
group by business_year+ R) x* \2 M& I* Y' S. V
union all0 X) D9 i. \4 T' o" l9 }
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area
" B& G# P4 L$ F/ Hfrom admissions_data_info; C/ O* C* T1 C6 w$ P+ A( S. l
group by business_year
- I8 T7 i$ V* a7 \2 v+ L)a( D; v L3 G# v0 Y: D9 o" K; x
where area=:area
! M1 q7 J/ y9 {order by x |