select * from (
$ Z0 I4 u4 ?* o3 y6 A) ~select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area0 H" l) c0 M" s1 R3 S% @
from admissions_data_info 8 C+ k' [) w. v
group by business_year,area
1 L! I9 C; H% w/ R0 ^5 Y9 X) Z0 aunion all) V! P. E* T: H8 ^
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area' f6 {+ j/ x, \ J8 I3 ^. l% g
from admissions_data_info
+ g, F1 L+ }; O! X! u6 e3 e0 \group by business_year,area2 R2 R2 c" y# M' j& p- A! }% d
union all, }( [( c+ l$ f* x- Z% b
select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area
) C' F8 b. J8 r$ i$ Yfrom admissions_data_info - q- V W& `' Z% y
group by business_year0 Z7 B$ x/ Z% N9 T/ N% q9 r* O
union all( ~2 o6 _7 r. j% U
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area
a3 T2 V" v$ K/ cfrom admissions_data_info
% ^$ S* Y0 j* egroup by business_year p% T! i4 d0 a* j, c7 F
)a, X6 f1 t* v0 J, I
where area=:area
& {6 R( X9 q zorder by x |