给位大佬帮帮忙呗,请帮我解答如何算出平均值
下面是一组数据SELECT '2019-01' AS Month, 'YT' AS BIZ, 'AP' AS Region, 100.90 AS Revenue
INTO T
UNION ALL
SELECT '2019-01' AS Month, 'ZY' AS BIZ, 'AP' AS Region, 200.90 AS Revenue
UNION ALL
SELECT '2019-01' AS Month, 'AIO' AS BIZ, 'AP' AS Region, 300 AS Revenue
UNION ALL
SELECT '2019-01' AS Month, 'XY' AS BIZ, 'AP' AS Region, 400 AS Revenue
UNION ALL
SELECT '2019-01' AS Month, 'AA' AS BIZ, 'AP' AS Region, 250 AS Revenue
UNION ALL
SELECT '2019-01' AS Month, 'BB' AS BIZ, 'AP' AS Region, 900 AS Revenue
UNION ALL
SELECT '2019-01' AS Month, 'XY' AS BIZ, 'EMEA' AS Region, 400 AS Revenue
UNION ALL
SELECT '2019-01' AS Month, 'AA' AS BIZ, 'EMEA' AS Region, 250 AS Revenue
UNION ALL
SELECT '2019-01' AS Month, 'BB' AS BIZ, 'EAEA' AS Region, 900 AS Revenue
UNION ALL
SELECT '2019-02' AS Month, 'AIO' AS BIZ, 'AP' AS Region, 300 AS Revenue
UNION ALL
SELECT '2019-02' AS Month, 'XY' AS BIZ, 'AP' AS Region, 400 AS Revenue
UNION ALL
SELECT '2019-02' AS Month, 'AA' AS BIZ, 'AP' AS Region, 250 AS Revenue
UNION ALL
SELECT '2019-02' AS Month, 'BB' AS BIZ, 'AP' AS Region, 900 AS Revenue
UNION ALL
SELECT '2019-02' AS Month, 'AIO' AS BIZ, 'EMEA' AS Region, 200 AS Revenue
UNION ALL
SELECT '2019-02' AS Month, 'XY' AS BIZ, 'EMEA' AS Region, 100 AS Revenue
UNION ALL
SELECT '2019-02' AS Month, 'AA' AS BIZ, 'EMEA' AS Region, 700 AS Revenue
UNION ALL
SELECT '2019-02' AS Month, 'BB' AS BIZ, 'EMEA' AS Region, 300 AS Revenue
UNION ALL
SELECT '2019-03' AS Month, 'AIO' AS BIZ, 'AP' AS Region, 300 AS Revenue
UNION ALL
SELECT '2019-03' AS Month, 'XY' AS BIZ, 'AP' AS Region, 400 AS Revenue
UNION ALL
SELECT '2019-03' AS Month, 'AA' AS BIZ, 'AP' AS Region, 250 AS Revenue
UNION ALL
SELECT '2019-03' AS Month, 'BB' AS BIZ, 'AP' AS Region, 900 AS Revenue
建表以后,
求月,地区,总值,平均值(相同区域跨月的平均)
下面的表格是期待的结果,数据略有出入,但大体的意思如图所示
谢谢