Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL Statement

Posted on 2014-10-27
4
Medium Priority
?
99 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 1000 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 49

Assisted Solution

by:PortletPaul
PortletPaul earned 1000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Loops Section Overview

926 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