I am working at ROLAP on Oracle and i have this Fact Table : Sales(market_id,item_id,sale), and i have this query :
SELECT market_id,item_id,SUM(sale) FROM Sales
GROUP BY CUBE(market_id,item_id);
Is there another way to get the same results but without using "CUBE" function ?
Te below query is an equivalent to a query with CUBE(market_id,item_id) clause (gives the same resultset).
But it will be slower, it will read the table 4 times - CUBE is optimized, it reads the table only once.