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