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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
2 Access tables, count verbiage used 6 21
Calculating Business Hours 19 65
select over clause 1 15
SQL 2008 Conversion failed 7 0
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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