SELECT id, amount FROM report
report.type='N'. How would I add this to the above question?
IF(type = 'P', amount, amount -1) as amount
IF(type = 'P', IFNULL(amount,0), IFNULL(amount,0) -1) as amount
when 'P' then amount
when 'N' then -amount
end as amount