SELECT id, amount FROM report
I need amount to be amount if report.type=\'P\' and -amount if
amount
report.type=\'P\'
-amount
You can try this also
SELECT id , IF(type='p', IFNULL(amount,0), IFNULL(amount,0) * -1) as amount FROM table