Requirement
You need SQL (example for a chart) that creates a trend or moving average from rows in your data.
Solution
Use SQL's built-in analytical function
SELECT null lnk
,diff label
,count(*) AS qty
,round(avg(count(*)) over (order by diff rows
between 3 preceding and 3 following)
,2) AS moving_avg
...
Acknowledgment
http://www.grassroots-oracle.com/2016/03/analytical-functions-apex-charts-moving-average.html
Comments
Post a Comment