I am new to oracle,
I have the code below
select base_station_key,date_key, time_key, sum(revenue_amt) as revenues, sum(mou) as mou from (
select call_duration_qty as mou, time_key, date_key, base_station_key, revenue_amt from bib_cdr.FCT_cdr_rated_sumd where dw_subpart=0
and date_key between 20150101 and 20150331 and package_key in (21395,22102,21448,18998) and usage_type_key=41
That code runs fast because it is partitioned on dw_subpart, there are 10 partitions and that means i have to run 10 times the same code. I was thinking of using a loop and create temporary tables which i can put together later.