SELECT warehouse, SUM(quantity) FROM inventory GROUP BY warehouse; +---------------+---------------+ | warehouse | SUM(quantity) | +---------------+---------------+ | San Fransisco | 560 | | San Jose | 650 | +---------------+---------------+ 2 rows in set