Folks,
I researched how to do running totals in Oracle, and found that Oracle has analytical functions like OVER .
However, when I tried this simple query it keeps giving me an error message ORA-00923, that a FROM keyword is expected right somewhere around the keyword "ORDER".
Please see example,
SELECT
B.REVENUE_DIVISION,
B.YEAR,
B.MONTH,
B.GROSS_BUDGET,
SUM(GROSS_BUDGET)
OVER (ORDER BY B.POST_YEAR, B.MONTH) AS "RUNNING_TOTAL"
FROM
GDW_DM.BUDGET B
And I get the error message with above keyword "ORDER" highlighted.
What am i doing wrong?
Thx,
mirogak
I researched how to do running totals in Oracle, and found that Oracle has analytical functions like OVER .
However, when I tried this simple query it keeps giving me an error message ORA-00923, that a FROM keyword is expected right somewhere around the keyword "ORDER".
Please see example,
SELECT
B.REVENUE_DIVISION,
B.YEAR,
B.MONTH,
B.GROSS_BUDGET,
SUM(GROSS_BUDGET)
OVER (ORDER BY B.POST_YEAR, B.MONTH) AS "RUNNING_TOTAL"
FROM
GDW_DM.BUDGET B
And I get the error message with above keyword "ORDER" highlighted.
What am i doing wrong?
Thx,
mirogak