If I am understanding the question correctly, you are looking for the following:
SELECT id, CASE
WHEN type = 'P' THEN amount
WHEN type = 'N' THEN -amount
ELSE amount END
FROM report
If I am understanding the question correctly, you are looking for the following:
SELECT id, CASE
WHEN type = 'P' THEN amount
WHEN type = 'N' THEN -amount
ELSE amount END
FROM report
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.