SELECT warehouse, product, SUM(quantity) FROM inventory GROUP BY ROLLUP (warehouse , product);