SQL Statement

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

update SALES_INVOICE set BaseAmount=BaseAmount*-1
 AND ACCOUNTNUM='81200810'
Question by:AXISHK
LVL 58

Expert Comment

ID: 40407740
Makes no sense!

Accepted Solution

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
LVL 48

Assisted Solution

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.

Author Closing Comment

ID: 40407794

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
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 …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

932 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

11 Experts available now in Live!

Get 1:1 Help Now