select sum(amount), footype from foo group by footype