Average for last 12 months
hi,
i have a column amount. i need to find the avg of it for last 12 months excluding current month.
I have got a query to find it .but it is adding current month also with it.
AVG(SUM(amount)) OVER (ORDER BY ACCOUNT_MONTH_NO
ROWS BETWEEN 12 PRECEDING AND 0 FOLLOWING) rolling_avg,
please help me to write a query as i am a naive user of oracle.