select * from (
* B0 O- d) x2 R% ~select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area
- U- \; Q' Y! ufrom admissions_data_info
" A/ B7 R% o# z" z: H8 Jgroup by business_year,area
) k( h5 C6 H# s6 x" Gunion all
% ~0 D. N$ G8 ^( v) D" v' Vselect business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area! [& e9 h ^4 R: ~+ V4 ?
from admissions_data_info- u {& W2 h) {0 l% k; D Y! ?" o$ H c
group by business_year,area- B/ u& X$ }% {$ l) |1 f- b
union all: w5 T% o W: }9 v- }3 x
select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area8 \3 x- u5 e: l
from admissions_data_info
0 c1 k3 F" U2 G: B$ R" @group by business_year' D; Z4 n; `5 V% o' U0 o6 J5 z
union all
: k2 x# S. }5 z5 j& Zselect business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area% d" B7 E( m8 N+ c: r3 j
from admissions_data_info" W& H) Y1 [4 b* K
group by business_year/ r3 _, V' {! s+ m
)a6 |$ {0 V2 t2 m f
where area=:area. L* B c% ]' z5 M7 C/ v
order by x |