Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 321
  • Last Modified:

Select statement

I have a table with 3 columns

id, parentID, pmtAmount

I want a select on all...but where parentID <> id return pmtAmount * -1
Else pmtAmount
0
lrbrister
Asked:
lrbrister
1 Solution
 
deightonCommented:
select id, parentid,
      CASE WHEN parentID <> id THEN pmtAmount * -1 ELSE pmtAmount END
          AS pmtAmountAdjusted
FROM YourTable
0
 
lrbristerAuthor Commented:
Thanks
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now