Solved

Select statement

Posted on 2011-09-12
2
260 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now