How to calculate moving average result using flink sql ?

Posted by Lifei Chen on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/How-to-calculate-moving-average-result-using-flink-sql-tp27330.html

Hi, all:

I have a `Order` table as follow:

rowtime  item     price
======= ======== ======
09:00   item1      10
09:01   item2      15 
09:03   item1       20


I want to calculate the moving average price in past 5 minutes, and emit the result for every record.
how to do this using flink sql? 


Regards
Lifei