Solved

SQL Statement

Posted on 2014-10-27
4
93 Views
Last Modified: 2014-10-27
What does "*" in below statement "BaseAmount=BaseAmount*-1"  mean ?


update SALES_INVOICE set BaseAmount=BaseAmount*-1
where  COMPANY='LEEJ'
 AND ACCOUNTNUM='81200810'
0
Comment
Question by:AXISHK
4 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40407740
Makes no sense!
0
 
LVL 8

Accepted Solution

by:
johny_bravo1 earned 250 total points
ID: 40407761
If your BaseAmount is 5000
then executing above statement will make it, -5000

In short it is like (YourColumnValue) * (-1)
So if your BaseAmount value is 5000 it will work as (5000) * (-1) = -5000
0
 
LVL 48

Assisted Solution

by:PortletPaul
PortletPaul earned 250 total points
ID: 40407774
It means multiply

* is multiply

The update statement is reversing the sign of the values by multiplying everything by minus one:
if something was a positive number before the update it is negative after the update, and if negative before the update it will be positive after the update.
0
 

Author Closing Comment

by:AXISHK
ID: 40407794
Tks
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

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.
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

832 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