stddev_samp在创建为视图时更改值

时间:2017-11-29 03:22:26

标签: mysql aggregate-functions standard-deviation

为什么当我按原样选择查询时,它运行良好?所以这是我的查询

SELECT
            AVG(total_score) AS AVGtotal_Score,
            STDDEV_SAMP(total_score) AS STDDEV_SAMPtotal_score,
            AVG(Total_Answer_Time) AS AVGTotal_Answer_Time,
            STDDEV_SAMP(Total_Answer_Time) AS STDDEV_SAMPTotal_Answer_Time,
            AVG(Total_Hint) AS AVGTotal_Hint,
            STDDEV_SAMP(Total_Hint) AS STDDEV_SAMPTotal_Hint,
            AVG(Total_Hint_Time) AS AVGTotal_Hint_Time,
            STDDEV_SAMP(Total_Hint_Time) AS STDDEV_SAMPTotal_Hint_Time
        FROM
            average_pivot

这是输出: z values image

当我尝试将它放在这样的视图中时:

create view ave_temp_z_table as (SELECT
            AVG(total_score) AS AVGtotal_Score,
            STDDEV_SAMP(total_score) AS STDDEV_SAMPtotal_score,
            AVG(Total_Answer_Time) AS AVGTotal_Answer_Time,
            STDDEV_SAMP(Total_Answer_Time) AS STDDEV_SAMPTotal_Answer_Time,
            AVG(Total_Hint) AS AVGTotal_Hint,
            STDDEV_SAMP(Total_Hint) AS STDDEV_SAMPTotal_Hint,
            AVG(Total_Hint_Time) AS AVGTotal_Hint_Time,
            STDDEV_SAMP(Total_Hint_Time) AS STDDEV_SAMPTotal_Hint_Time
        FROM
            average_pivot);

stddev_samp的输出发生了变化..视图的输出是这样的 z values as a view

0 个答案:

没有答案