SELECT c1, c2, aggregate_function(c3) FROM table GROUP BY ROLLUP (c1, c2);