select * from (
7 q6 _2 p8 h! |4 l: x( X- xselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000,1) y ,'招生人数' as s ,area. a' Q/ V% \3 L+ r8 \3 g
from admissions_data_info
+ e/ [3 ~4 C5 M( s8 igroup by business_year,area
( K" c& r- L* ?' ]union all
5 f6 L2 X* \* m7 Aselect business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,area# Q _5 ], _ @0 r/ N
from admissions_data_info
! h1 h N/ R. z# d2 q( y5 ygroup by business_year,area- O% Q; F. o8 t+ [
union all
1 P% N+ P* @" M8 n2 t5 Eselect business_year x,round(cast(sum(recruit_student_count) as decimal(20,2))/1000 ,1) y ,'招生人数' as s ,'所有区县' area7 ~8 N# |9 P, _/ r; Z# M
from admissions_data_info
8 }! p* p" {3 v$ |6 k; O* \group by business_year
: g) {1 i7 S8 f7 v1 n0 n7 wunion all
3 G# G. ?. R) |$ x" I' ?' T ^select business_year x,round(cast(sum(school_age_number) as decimal(20,2))/1000,1) y ,'入学缺口' as s ,'所有区县' area
P# e8 C. ~: Ifrom admissions_data_info
- T" p) X' O+ @5 k: xgroup by business_year
5 C, c& [7 J* S0 A( x)a7 H) G# h$ K, \7 f) P+ @7 H
where area=:area; n0 f4 Z) r: z8 ~. m: J; H
order by x |