SELECT id, amount FROM report
I need amount to be amount if report.type=\'P\' and -amount if
amount
report.type=\'P\'
-amount
Use a case statement:
case
select id, case report.type when 'P' then amount when 'N' then -amount end as amount from `report`