SELECT
ftl.province,
-- 身高平均值
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=1 and ftl1.grade_type='2' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as xiaoban_shengao,
(SELECT CAST(AVG(ftl1.report_one ) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=1 and ftl1.grade_type='1' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as zhongban_shengao,
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=1 and ftl1.grade_type='0' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as daban_shengao,
-- 体重平均值
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=2 and ftl1.grade_type='2' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as xiaoban_tizhong,
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=2 and ftl1.grade_type='1' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as zhongban_tizhong,
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=2 and ftl1.grade_type='0' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as daban_tizhong,
-- 臂展平均值
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=4 and ftl1.grade_type='2' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as xiaoban_bizhan,
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=4 and ftl1.grade_type='1' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as zhongban_bizhan,
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=4 and ftl1.grade_type='0' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as daban_bizhan,
-- 胸围平均值
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=6 and ftl1.grade_type='2' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as xiaoban_xiongwei,
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=6 and ftl1.grade_type='1' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as zhongban_xiongwei,
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=6 and ftl1.grade_type='0' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as daban_xiongwei,
-- 肺活量平均值
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=5 and ftl1.grade_type='2' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as xiaoban_feihuoliang,
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=5 and ftl1.grade_type='1' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as zhongban_feihuoliang,
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=5 and ftl1.grade_type='0' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as daban_feihuoliang,
-- 左眼视力平均值,右眼视力平均值
(SELECT CAST(AVG(SUBSTRING_INDEX(ftl1.report_one,'/',1)) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=3 and ftl1.grade_type='2' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as xiaoban_zuoyan,
(SELECT CAST(AVG(SUBSTRING_INDEX(ftl1.report_one,'/',-1)) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=3 and ftl1.grade_type='2' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as xiaoban_youyan,
(SELECT CAST(AVG(SUBSTRING_INDEX(ftl1.report_one,'/',1)) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=3 and ftl1.grade_type='1' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as zhongban_zuoyan,
(SELECT CAST(AVG(SUBSTRING_INDEX(ftl1.report_one,'/',-1)) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=3 and ftl1.grade_type='1' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as zhongban_youyan,
(SELECT CAST(AVG(SUBSTRING_INDEX(ftl1.report_one,'/',1)) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=3 and ftl1.grade_type='0' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as daban_zuoyan,
(SELECT CAST(AVG(SUBSTRING_INDEX(ftl1.report_one,'/',-1)) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=3 and ftl1.grade_type='0' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as daban_youyan,
-- 坐位体前屈平均值
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=8 and ftl1.grade_type='2' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as xiaoban_zuoweiti,
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=8 and ftl1.grade_type='1' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as zhongban_zuoweiti,
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=8 and ftl1.grade_type='0' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as daban_zuoweiti,
-- 体脂率平均值
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=7 and ftl1.grade_type='2' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as xiaoban_tizhilv,
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=7 and ftl1.grade_type='1' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as zhongban_tizhilv,
(SELECT CAST(AVG(ftl1.report_one) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_foundation_id=7 and ftl1.grade_type='0' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as daban_tizhilv,
-- 跑动平均值
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=10 and ftl1.grade_type='2' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as xiaoban_paodong,
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=9 and ftl1.grade_type='1' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as zhongban_paodong,
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=1 and ftl1.grade_type='0' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as daban_paodong,
-- 跳跃平均值
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=12 and ftl1.grade_type='2' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as xiaoban_tiaoyue,
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=11 and ftl1.grade_type='1' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as zhongban_tiaoyue,
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=2 and ftl1.grade_type='0' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as daban_tiaoyue,
-- 敏捷平均值
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=14 and ftl1.grade_type='2' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as xiaoban_mingjie,
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=13 and ftl1.grade_type='1' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as zhongban_mingjie,
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=3 and ftl1.grade_type='0' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as daban_mingjie,
-- 协调平均值
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=18 and ftl1.grade_type='2' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as xiaoban_xietiao,
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=17 and ftl1.grade_type='1' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as zhongban_xietiao,
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=5 and ftl1.grade_type='0' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as daban_xietiao,
-- 力量平均值
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=20 and ftl1.grade_type='2' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as xiaoban_liliang,
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=19 and ftl1.grade_type='1' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as zhongban_liliang,
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=6 and ftl1.grade_type='0' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as daban_liliang,
-- 左脚平衡平均值,右脚平衡平均值
(SELECT CAST(AVG(SUBSTRING_INDEX(ftl1.report_three,'/',1)) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=16 and ftl1.grade_type='2' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as xiaoban_zuojiaopingheng,
(SELECT CAST(AVG(SUBSTRING_INDEX(ftl1.report_three,'/',-1)) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=16 and ftl1.grade_type='2' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as xiaoban_youjiaopingheng,
(SELECT CAST(AVG(SUBSTRING_INDEX(ftl1.report_three,'/',1)) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=15 and ftl1.grade_type='1' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as zhongban_zuojiaopingheng,
(SELECT CAST(AVG(SUBSTRING_INDEX(ftl1.report_three,'/',-1)) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=15 and ftl1.grade_type='1' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as zhongban_youjiaopingheng,
(SELECT CAST(AVG(SUBSTRING_INDEX(ftl1.report_three,'/',1)) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=4 and ftl1.grade_type='0' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as daban_zuojiaopingheng,
(SELECT CAST(AVG(SUBSTRING_INDEX(ftl1.report_three,'/',-1)) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=4 and ftl1.grade_type='0' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as daban_youjiaopingheng,
-- 物体控制(手)平均值
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=22 and ftl1.grade_type='2' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as xiaoban_wutikongzhishou,
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=21 and ftl1.grade_type='1' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as zhongban_wutikongzhishou,
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=7 and ftl1.grade_type='0' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as daban_wutikongzhishou,
-- 物体控制(脚)平均值
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=27 and ftl1.grade_type='2' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as xiaoban_wjiaoongzhijiao,
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=26 and ftl1.grade_type='1' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as zhongban_wjiaoongzhijiao,
(SELECT CAST(AVG(ftl1.report_three) AS DECIMAL(10,2)) from fo_testing_log ftl1 where ftl1.testing_sports_id=25 and ftl1.grade_type='0' and ftl1.province=ftl.province and ftl1.createtime >= 1609430400 and ftl1.createtime <= 1640966399 ) as daban_wjiaoongzhijiao
from fo_atte_school ftl
group by ftl.province
数据分析二
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- 大家好,我是从零开始菜鸡娜。o(〃'▽'〃)o 从零开始是我的强项,也是我很享受的事情。一直以来我都在不断地整理背...
- 还没看过第一篇的童鞋看过来~不要再怕数据分析!深入浅出数据分析(一)基本流程思路 不要怕数据分析!咖喱欧巴也在边摸...