select a.ym,b.c1,b.c2,b.c3 from 
  (
     select t2.y||t1.m ym 
       from
         (
            select '2004'-1 y from dual union 
            select '2004'+0 from dual union 
            select '2004'+1 from dual
          ) t2,
         (
            select ltrim(to_char(rownum,'00')) m from 
                all_tables where rownum<13
          ) t1
  ) a,
 (
    select year,sum(a1) c1,sum(a2) c2,sum(a3) c3 from a 
         where substr(a.year,0,4) in ('2004'-1,'2004'+0,'2004'+1)
  ) b
where a.ym=b.year(+);