How to calculated multiple moving average in MySQL

后端 未结 3 1104
Happy的楠姐
Happy的楠姐 2020-12-11 23:49

Using table below, How would get a column for 5 period moving average, 10 period moving average, 5 period exponential moving average.

+--------+------------         


        
3条回答
  •  温柔的废话
    2020-12-12 00:17

    The 5-row moving average in your example won't work. The LIMIT operator applies to the return set, not the rows being considered for the aggregates, so changing it makes no difference to the aggregate values.

提交回复
热议问题