sabato 25 settembre 2010

Oracle YTD Calculation using analytical functions (sum up monthly)

This is the script's table:

CREATE TABLE KRIMISIA.CB_TEST
(
  MONTH_REF NUMBER,
  MONTH_VALUE NUMBER
)

Table will look like this:


This is the query:

select
  MONTH_REF
  ,sum(MONTH_VALUE) over (order by MONTH_REF rows unbounded preceding) MONTHLY_VALUE_YTD
from
(
  select MONTH_REF, sum(MONTH_VALUE)as MONTH_VALUE
  from CB_TEST
  group by MONTH_REF
)

... and ...



Ciao,
Claudio

2 commenti:

Unknown ha detto...


Why users still make use of to read news papers when in this technological world all is available on net? paypal login

landrieeason ha detto...

Caesars Palace to open new sportsbook, retail on site in Las Vegas
Caesars Palace will become the new 제천 출장안마 retail 의정부 출장안마 location of Caesars Palace's new retail 삼척 출장안마 facility 충청북도 출장샵 in the Wynn 김포 출장마사지 Las Vegas.