Sql

Asked • 04/29/19

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

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?

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.