SUM(CASE WHEN column = value THEN column END) alias eg SUM(CASE WHEN car.brand = 'Toyota' THEN sales END) toyota_sales
SELECT SUM(amount) FROM account;