select * from (
8 Q; V8 `: z3 S9 _6 Q3 O5 Z! y. Pselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area1 K5 e3 b: o; x4 U7 x' T
from admissions_data_info + y A- l1 B5 s w
group by business_year,area/ y! d0 C0 L/ l% Q8 }+ }
union all
* h" C0 \5 o) ~5 u% }7 j, dselect business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area$ R1 B* a2 h+ H
from admissions_data_info2 `) Y8 [3 w* W$ F% ?. e
group by business_year,area
9 W7 _ x; b' e, W. Aunion all
% @; S' X3 w" U) ]- m/ uselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area0 k. }7 [1 P! g$ H; _3 f" h3 f
from admissions_data_info
: Z8 Z. a% y! fgroup by business_year
4 [% K h3 u# r Junion all
% Q* b" q3 N5 B! e6 |select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area0 M8 W% L4 q' [+ }5 {2 E
from admissions_data_info
% ?3 b! @1 }% |- Vgroup by business_year
1 |+ x& @4 e& f+ ~)a& ]+ T" @ J; @& V7 @- }- A
where area=:area8 i+ d& c* A! c8 Z2 w, |
order by x |