Solved

How do I perform mathematical update from fields using select statement

Posted on 2012-03-13
2
319 Views
Last Modified: 2012-03-13
I would like be able to update multiple fields with a mathematical function. For example in this example query I would like each field to be 76% of the original fields value.

select CHARGE from SHCOSTS where COST_CODE='R'and L_WEIGHT < 5.001
which output's


5.490
5.840
5.930
6.070
6.250
5.830
6.220
6.490
6.680
6.770
5.940
6.740
7.080
7.440
7.750
6.200
6.880
7.300
7.780
8.090
6.490
7.260
7.690
8.070
8.390
6.580
7.410
7.900
8.420
8.780
6.690
7.660
8.460
9.060
9.540
20.620
22.900
24.930
27.220
29.590
5.020
5.070
5.100
5.160
5.200
20.620
22.900
24.930
27.220
29.590
5.090
5.140
5.170
5.230
5.290
7.830
8.460
9.940
11.190
12.720
8.070
8.700
10.210
11.800
13.410
14.150
15.400
15.950
17.050
18.150
22.250
23.400
24.600
25.750
26.550
7.830
8.460
9.940
11.190
12.720
8.070
8.700
10.210
11.800
13.410
0
Comment
Question by:elusivedisc
2 Comments
 
LVL 9

Accepted Solution

by:
macarrillo1 earned 500 total points
ID: 37715650
Try:

update SHCOSTS
set CHARGE = CHARGE *0.76
where COST_CODE='R'and L_WEIGHT < 5.001
0
 

Author Closing Comment

by:elusivedisc
ID: 37715873
Worked perfect thank you.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
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.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 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

13 Experts available now in Live!

Get 1:1 Help Now