Use CUBE and ROLLUP to calculate aggregates at many levels in one statement: http://docs.oracle.com/cd/E11882_01/server.112/e25554/aggreg.htm#DWHSG8613 ROLLUP example ============== SELECT channel_desc, calendar_month_desc, countries.country_iso_code, TO_CHAR(SUM(amount_sold), ‘9,999,999,999’) SALES$ FROM sales, customers, times, channels, countries WHERE sales.time_id=times.time_id AND sales.cust_id=customers.cust_id AND customers.country_id = countries.country_id AND sales.channel_id= …

Oracle: CUBE and ROLLUP aggregations Read more »