I'm thinking of a way to sum a column but if one of the rows has an 02 or 03 in there the charge to sum is not what is shown and should be changed.
SELECT serial, email, SUM(charge) as amountpayable From billings where charge > '0' GROUP BY email.
This displays as intended but for instance if column type is equal to 02 or 03 I need to change the charge field from .10 to .50 and if the type field is equal to 04 or 05 I need to change the charge field from .20 to .80 for the sum to some out correctly.
I'm not quite up to speed on IF statements in MySQL but guessing that would be the way.
View on Stack Overflow
