LMSouq
general-dev Open

'IF' in 'SELECT' statement - choose output value based on column values

MI
Michael
1 month ago
3 views
Problem Description
SELECT id, amount FROM report I need `amount` to be `amount` if `report.type='P'` and `-amount` if `report.type='N'`. How do I add this to the above query?

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base