Make sum for one column based on codition from another column in php? : I have one mySql table with two columns: amount (INT) and address (string).
All addresses start with "A" or "B".
How can I calculate the sum of all amounts for which address starts with "A" and sum of all amounts for which address start with "B".
I would prefer to do this in PHP rather than in mysql directlly.

