Solved

Select statement

Posted on 2011-09-12
2
292 Views
Last Modified: 2012-05-12
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
Comment
Question by:lrbrister
2 Comments
 
LVL 18

Accepted Solution

by:
deighton earned 500 total points
ID: 36523874
select id, parentid,
      CASE WHEN parentID <> id THEN pmtAmount * -1 ELSE pmtAmount END
          AS pmtAmountAdjusted
FROM YourTable
0
 

Author Closing Comment

by:lrbrister
ID: 36524043
Thanks
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to shrink a transaction log file down to a reasonable size.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question