Você precisa de uma consulta como esta. Certifique-se de incluir
NULL
verifica Data1 ,Data2 quando faltam registros para datas futuras ou datas passadas e o padrão para zero, se necessário. select To_CHAR(Month,'MON-YY') Month,
CASE
WHEN MOD ( EXTRACT ( MONTH FROM Month ), 3 ) = 1
THEN Data2 + LEAD ( Data2 ,1) OVER ( ORDER BY Month ) + LEAD ( Data2 ,2) OVER ( ORDER BY Month )
WHEN MOD ( EXTRACT ( MONTH FROM Month ), 3 ) = 2
THEN LAG(Data1,1) OVER ( ORDER By Month ) + Data2 + LEAD ( Data2 ,1) OVER ( ORDER BY Month )
WHEN MOD ( EXTRACT ( MONTH FROM Month ), 3 ) = 0
THEN LAG(Data1,2) OVER ( ORDER By Month ) + LAG(Data1,1) OVER ( ORDER By Month )+Data2
END data
FROM
Table1;
SQLFiddle