select distinct MONTH_NBR MONTH,sum(nvl(VALUE_NBR,0)) TOTVAL FROM
(
select c.time_id,c.VALUE_NBR VALUE_NBR
from tab1 a,tab2 c
where a.r_id=c.r_id
and (a.descr like '%Count')
) z, timedim b
WHERE
b.TIME_ID=z.TIME_ID(+)
GROUP BY MONTH_NBR
Output we're gettng for the above query (...