I need to do something like:
SELECT value_column1
FROM table1
WHERE datetime_column1 >= '2009-01-01 00:00:00'
ORDER BY datetime_column1;
Except in addition to value_column1
, I also need to retrieve a moving average of the previous 20 values of value_column1
.
Standard SQL is preferred, but I will use MySQL extensions if necessary.