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