SyntaxFix
Write A Post
Hire A Developer
Questions
Use a case statement:
case
select id, case report.type when 'P' then amount when 'N' then -amount end as amount from `report`