select * from (
6 z+ ?' m& J7 \0 a" g* `select business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area
4 O& Y! h0 K- c8 q4 U; Xfrom admissions_data_info
- L. x+ l' ?9 n$ y1 _* V1 ggroup by business_year,area [2 k. X1 O( z9 j% ~# m
union all! j- H- n) ^7 E
select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area% _2 d# w& W8 A S
from admissions_data_info. |' L2 D) q& \
group by business_year,area0 w# T5 F7 f7 d; t. h
union all
3 F1 A4 _& ?2 Q' f# }& G' Fselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area
* E8 d9 m* r) |0 N) S' j) L8 S- G% rfrom admissions_data_info / W7 e* K! L6 n; D
group by business_year
( S1 x' W! n+ b; m" |! }* dunion all
5 M1 i8 P( F2 g! M. [6 dselect business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area8 a! O5 m( I9 r. R( p1 e7 I
from admissions_data_info& \6 w' Q" {5 Y) R3 }+ \
group by business_year
: G- B& t* |+ x- r9 y)a
; T# \1 r6 I: ?' Q3 r. w6 X7 E" Gwhere area=:area
1 [) x2 B: }# [* P, m Eorder by x |