Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Average for last 12 months

asim cholasSep 14 2012 — edited Sep 14 2012
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.
This post has been answered by jeneesh on Sep 14 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 12 2012
Added on Sep 14 2012
3 comments
1,242 views