美文网首页
数据分析二

数据分析二

作者: knock | 来源:发表于2022-01-18 11:16 被阅读0次
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 

相关文章

网友评论

      本文标题:数据分析二

      本文链接:https://www.haomeiwen.com/subject/slrkhrtx.html